I want to query two DataTables
(populated by parsing Excel files) using LINQ and join them on a matching field, "UPC", as follows:
Dim query = From c In dt.AsEnumerable() _
Join r In dtUnits.AsEnumerable() _
On c.Field(Of String)("UPC") Equals r.Field(Of String)("UPC") _
Select New With {.UPC = r.Field(Of String)("UPC")}
Additionally, I want to copy this LINQ query result to a DataTable. I found a method CopyToDataTable()
, but it is in .NET 4.5, and our server only supports .NET 3.5.
What can I do to emulate this functionality in VB .NET 3.5?
Thank you!