RowViewFilter

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

Jim Heavey

Having some problems with setting my RowViewFilter when I am looking for a
column with Null Values.

I have tried the following:

dvAddSkaters_Lstv.RowFilter=
string.Format("(DateJoined = '{0}')",System.DBNull.Value.ToString())

This is obviously wrong, as when I look at it in the editor there is
nothing which shows up for the null value. And then when there are
actually rows in the datatable, I get an exception about comparing string
with datetime.

How do I properly set this in C#?
 
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
 
Thanks Bill, it did not work for me. I went looking in help on the ISNULL
function, but there was none. At first I though it was a VB command but
then I realized that this was a SQL function.

The reason it would not work for me is because it was a date, so I changed
it to something like the following:

ISNULL(DateInactivated,'1/1/1900')='1/1/1900'

and that worked fine.

It took me a while to get there, but thanks a bunch!!!!!!!!!!!
 
Jim, I'm glad you got it to work, but FYI, it's a SQL Function but it's also
one you can use as an Expression if you need it.
 
Back
Top