I'm trying to use the DataTable's Select method to find null values. My code looks like this:
dataTable.Select("FieldName=NULL")
The dataTable object has null values but nothing is ever returned (Length=0). How do I write the filterExpression parameter to retrive null values? Thanks
futbolstar
Member
15 Points
3 Posts
Using DataTable's Select method to find null values
Sep 29, 2004 07:57 PM|LINK
dataTable.Select("FieldName=NULL")The dataTable object has null values but nothing is ever returned (Length=0). How do I write the filterExpression parameter to retrive null values? Thanksndinakar
All-Star
49092 Points
6868 Posts
Moderator
MVP
Re: Using DataTable's Select method to find null values
Sep 29, 2004 11:46 PM|LINK
'if dr is the datarow if not dr("columnname") is system.dbnull.value then 'do your stuff end ifyou can also do something likeif not IsDbNull(dr("column")) then ' do your stuff. end ifhthDinakar Nethi
Life is short. Enjoy it.
***********************
RemithR
Contributor
2376 Points
396 Posts
Re: Using DataTable's Select method to find null values
Apr 22, 2009 07:06 PM|LINK
Please use:
dataTable.Select("FieldName is NULL")
this will give you the DataRows with null values in FieldName column.