DBnull in Linq query causing problems

Posted by nat on Stack Overflow See other posts from Stack Overflow or by nat
Published on 2009-12-03T18:01:22Z Indexed on 2010/03/24 0:03 UTC
Read the original article Hit count: 339

Filed under:
|

hi there

i am doing a query thus:

int numberInInterval = (from dsStatistics.J2RespondentRow item in jStats.J2Respondent
                   where item.EndTime > dtIntervalLower && item.EndTime <= dtIntervalUpper
                   select item).count();

there appear to be some dbnulls in the endtime column.. any way i can avoid these?

tried adding && where item.endtime != null.. and even != dbnull.value

do i have to do a second (first) query to grab all that arent null then run the above one?

im sure its super simple fix, but im still missing it.. as per

thanks nat

© Stack Overflow or respective owner

Related posts about LINQ

Related posts about dbnull