Hi All,
I’m trying to join two datatables using linq operations. The operations throws me null reference exception not sure what I’m doing wrong. Have attached the xaml file for reference.
DataTable1 : DataDT
ID Name City Age Hobbies
|2|Sam|Mumbai|22|Guitar|
|3|Ham|Delhi|12|Base*|
|4|Kam|Chennai|33|Nothing|
DataTable2 : DT2
Sales ID Name City Age Hobbies Salary
|2|Sam|Mumbai|22|Guitar|334|
|3|Ham|Delhi|12|Base*|44|
|6|Kam|Chennai|33|Nothing|555|
Linq query used: Result = (From tb1 In DataDT.AsEnumerable() _
Join tb2 In DT2.AsEnumerable() _
On tb2.Field(Of Double)(“Sales ID”) Equals tb1.Field(Of Double)(“ID”)
Select Result.LoadDataRow(New Object(){tb1.Field(Of String)(“City”)},False)).CopyToDataTable
Data.xlsx (8.8 KB)
Linq.xaml (8.4 KB)
Any kind of assistance would be helpful. Thank you in advance