First, take a look at this thread
http://stackoverflow.com/questions/881225/linq-to-dataset-dbnull-problem-null-reference-exception
The link above provides you how to LEFT JOIN and then SELECT column that have NULL value in it without taking Exception error
My problem is I want to COUNT the column is null in WHERE clause (after my LEFT JOIN, some NULL value pop up in the column), something like this
int tmp1 =
(
from n in dt_query
join m in dt_query2
on n.Field<string>("VC_CLIENT_MAXID") equals m.Field<string>("VC_CHAT_MAXID") into nm
from m in nm.DefaultIfEmpty()
where
//string.IsNullorEmpty(m.Field<string>("VC_CHAT_STAFF"))
//DBNull.Value.Equals(m.Field<string>("VC_CHAT_STAFF"))
//m.IsNull("VC_CHAT_STAFF")
//object.Equals(m.Field<string>("VC_CHAT_STAFF"), xxx) <<< String xxx = null on above
select n.Field<string>("VC_CLIENT_MAXID")
).Count();
the commented lines are the solution I tried but it didn't work for me
Every help would be appreciate
ps. Sorry for my poor edited text, this is my first time on this forum
ps2. Code format edited, it takes me a while.