How to filter on a field with null

Posts   
 
    
Stephan
User
Posts: 63
Joined: 16-Jan-2007
# Posted on: 15-Jan-2008 17:29:17   

Hi, how can I create a filter in which I want to retrieve only values of the dB for which a certain field has a null value.

the code below throws an exception at the second line. Apparently, I cannot filter like that.


IPredicateExpression filter = new PredicateExpression(ClientUnitFields.ClientId == clientId);
filter.AddWithAnd(ClientUnitFields.EndDate == null);

Any directions.

TIA

DvK
User
Posts: 318
Joined: 22-Mar-2006
# Posted on: 15-Jan-2008 20:58:14   

....use Dbnull.Value instead....

Stephan
User
Posts: 63
Joined: 16-Jan-2007
# Posted on: 16-Jan-2008 11:59:39   

Thanks Dvk. That worked for me