Can you pls advise how can i modify this linq query to add one more column.
(From table1 In Dt1.AsEnumerable() Join table2 In dt2.AsEnumerable() On table1.Item(“Merchant Charge Ref”).ToString Equals table2.item(“Cheque No.”)
Let ra = table1.ItemArray.Concat(New Object(){table2(“Cheque No.”),table2}).toArray
Select r = FilterData1.Rows.Add(ra)).copytodatatable
(From table1 In Dt1.AsEnumerable()
Join table2 In dt2.AsEnumerable() On table1.Item(“Merchant Charge Ref”).ToString() Equals table2.item(“Cheque No.”)
Let ra = table1.ItemArray.Concat(New Object() {table2(“Cheque No.”), table2, “Additional Column Value”}).ToArray()
Select r = FilterData1.Rows.Add(ra)).CopyToDataTable()
(From table1 In Dt1.AsEnumerable() Join table2 In dt2.AsEnumerable() On table1.Item("Merchant Charge Ref").ToString Equals table2.item("Cheque No.")
Let ra = table1.ItemArray.Concat(New Object(){table2("BT Advise number"),table2("Payment id")}).toArray
Select r = FilterData1.Rows.Add(ra)).copytodatatable
The above Query should work provided that FilterData1 has number of columns in table1+2
Also, Not so sure Why initially you were adding Check No. column in the Output.
Also, Would like to know what exactly was the issue in using the Join Datatables activity.
Dim filteredData = (From table1 In Dt1.AsEnumerable()
Join table2 In dt2.AsEnumerable() On table1.Item(“Merchant Charge Ref”).ToString() Equals table2.Item(“Cheque No.”)
Let ra = table1.ItemArray.Concat(New Object() {table2(“Cheque No.”), table2, “Additional Column Value”}).Take(FilterData1.Columns.Count).ToArray()
Select r = FilterData1.Rows.Add(ra)).CopyToDataTable()