RowViewFilter and Nulls

  • Thread starter Thread starter Jim Heavey
  • Start date Start date
J

Jim Heavey

If you are trying to set a filter where a particulare column is null or not
null, how do you do this?

MyDataView = string.Format("MyField1 = '{0}' and MyField2 = '{1}'", "Fred",
System.DbNull.Value).

Would that be correct? Value.ToString()?
 
Jim, you can use ISNull(MyField1, 'Null') = 'Null'
or use the negatoin. I belive you can use all of the functions that are
allowed in an expression column from the DataTable as well as IsNull.

HTH,

Bill
 
Back
Top