I've got what I think is a working left outer join linq 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
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
I want to return all of e
and one column from c
called tClassCode
. I was wondering what the syntax would be. As you can see I'm using vb.net.
Thanks.
Update.. Here is the query doing join where i get the error _message = "Object reference not set to an instance of an object."
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
If i remove the c.tClassCode from the select the query runs without error. So i though perhaps i needed to do a select new but i don't think i was doing that correctly either.