title: LINQ to Dataset Left Join, how to Count nulls
body: <p>First, take a look at this thread</p>
  
  <p><a href="https://stackoverflow.com/questions/881225/linq-to-dataset-dbnull-problem-null-reference-exception">LINQ to Dataset DBNULL problem / null reference exception</a></p>
  
  <p>The link above provides you how to LEFT JOIN and then SELECT column that have NULL value in it without taking Exception error.</p>
  
  <p>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:</p>
  
  <pre><code>int tmp1 = 
  (
  from n in dt_query
  join m in dt_query2 
  on n.Field&lt;string&gt;("VC_CLIENT_MAXID") equals m.Field&lt;string&gt;("VC_CHAT_MAXID") into nm
  from m in nm.DefaultIfEmpty()
  where 
      //string.IsNullorEmpty(m.Field&lt;string&gt;("VC_CHAT_STAFF"))
      //DBNull.Value.Equals(m.Field&lt;string&gt;("VC_CHAT_STAFF"))
      //m.IsNull("VC_CHAT_STAFF")
      //object.Equals(m.Field&lt;string&gt;("VC_CHAT_STAFF"), xxx) &lt;&lt;&lt; String xxx = null on above
      select n.Field&lt;string&gt;("VC_CLIENT_MAXID")
      ).Count();
  </code></pre>
  
  <p>The commented lines are the solution I tried but it didn't work for me.  Any help would be appreciated.</p>