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

Popular posts from this blog

magento2 - Magento 2 admin grid add filter to collection -

Android volley - avoid multiple requests of the same kind to the server? -

Combining PHP Registration and Login into one class with multiple functions in one PHP file -