sql - Linq return nothing if nullable data is compared -
i have column in database value null. , reading value in linq result linq not return result. linq looks
dim result= (from t in <tablename> i.id=pid)
pid passed nothing , db consist id value null linq should return result not return. why ?
this query translated sql following clause:
where [t1].[id] = @p1
the problem here null comparison semantics in sql returns null, not true, , row filtered.
you want, instead, have clause:
where [t1].[id] null
which can different query.
dim result= (from t in <tablename> i.id nothing)
Comments
Post a Comment