I am trying to join two datatables which I have nearly done after searching the web for examples.
The problem I have is it only shows the rows where there is a match; how do I show all of the rows in t1 and then if there is a match show something in a column to say there is a match?
Below is the code I am using:
Dim Query = From t1 In dt.AsEnumerable() Join t2 In dt2.AsEnumerable()
On t1.Field(Of String)("Surname") Equals t2.Field(Of String)("VisitorFob")
Select New With {.Surname = t1.Field(Of String)("Surname"), .VisitorFob = t2.Field(Of String)("VisitorFob")}
Dim newTable As New DataTable()
newTable.Columns.Add("Surname", GetType(String))
newTable.Columns.Add("VisitorFob", GetType(String))
For Each rowInfo In Query
newTable.Rows.Add(rowInfo.Surname, rowInfo.VisitorFob)
Next