How to filter a DataView.RowFilter

3

I have a DataView and I'm trying to make a filter, where the 'photo' field is different from NULL

I tried:

 dv.RowFilter = "foto <> ''";

But it did not filter. I searched here on StackOver and recommended:

dv.RowFilter = "Isnull(foto,'') <> ''";

I also tried:

dv.RowFilter = "Isnull(foto, 'Null Column') != 'Null Column'";

With: "foto <> null" it does not return any results.

Same thing, does not filter, in database it returns as NULL

When I make a simple filter of type

dv.RowFilter = "foto ='123412341234.jpg'";

works perfectly.

    
asked by anonymous 07.01.2016 / 17:54

1 answer

4

I discovered, incidentally would be the most logical, being that follows the standard of MS SQL. I tried doing it via LINQ format and it did not work.

Only NULL

dv.RowFilter = "foto IS NULL";

Only those with registration (not null)

dv.RowFilter = "foto IS NOT NULL";

It worked perfectly.

    
07.01.2016 / 19:13