Link to home
Start Free TrialLog in
Avatar of mugsey
mugseyFlag for United Kingdom of Great Britain and Northern Ireland

asked on

check for null in linq to sql

If query one table in linq to sql; how can I check if one fileld (an image field set to binary in dbml) is null or empty.

So say something like this

var results = from p in mycontext
                    where p.ID == _itemId  && p.photograph <> null
                       select p.photograph ;    
Avatar of Guy Hengel [angelIII / a3]
Guy Hengel [angelIII / a3]
Flag of Luxembourg image

IS NOT NULL
instead of <> NULL
Avatar of mugsey

ASKER

Thanks but this does not let me

The photograph field of of type BYTE so I need to check if there is nothing in that field
ASKER CERTIFIED SOLUTION
Avatar of Guy Hengel [angelIII / a3]
Guy Hengel [angelIII / a3]
Flag of Luxembourg image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial