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 ;    
mugseyAsked:
Who is Participating?
 
Guy Hengel [angelIII / a3]Billing EngineerCommented:
please try this:

var results = from p in mycontext
                    where p.ID == _itemId  && p.photograph != null
                       select p.photograph ;     

Open in new window

0
 
Guy Hengel [angelIII / a3]Billing EngineerCommented:
IS NOT NULL
instead of <> NULL
0
 
mugseyAuthor Commented:
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
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.