title: Left outer join null using VB.NET and LINQ
body: <p>I've got what I think is a working left outer join <a href="http://en.wikipedia.org/wiki/Language_Integrated_Query" rel="nofollow noreferrer">LINQ</a> query, but I'm having problems with the select because of null values in the right hand side of the join. Here is what I have so far</p>
  <pre><code> Dim Os = From e In oExcel
          Group Join c In oClassIndexS On c.tClassCode Equals Mid(e.ClassCode, 1, 4)
          Into right1 = Group _
          From c In right1.DefaultIfEmpty
  </code></pre>
  <p>I want to return all of <code>e</code> and one column from <code>c</code> called <code>tClassCode</code>. I was wondering what the syntax would be. As you can see, I'm using <a href="http://en.wikipedia.org/wiki/Visual_Basic_.NET" rel="nofollow noreferrer">VB.NET</a>.</p>
  <h3>Update...</h3>
  <p>Here is the query doing join where I get the error:</p>
  <blockquote>
  <p>_message = &quot;Object reference not set to an instance of an object.&quot;</p>
  </blockquote>
  <pre><code> Dim Os = From e In oExcel
               Group Join c In oClassIndexS On c.tClassCode Equals Mid(e.ClassCode, 1, 4)
               Into right1 = Group _
               From c In right1.DefaultIfEmpty
          Select e, c.tClassCode
  </code></pre>
  <p>If I remove the c.tClassCode from the select, the query runs without error. So I thought perhaps I needed to do a select new, but I don't think I was doing that correctly either.</p>