Can you please show us the structure of the Data Tables?
Are the column names same for both of them?
If so you can use Merge DataTable activity directly
you can use the below code for merge data table using linq query.
Imports System.Linq
’ Assuming dt1 and dt2 are the two DataTables you want to merge based on a common column
’ Assuming the common column name is “ID”
’ Merge dt2 into dt1 based on common column “ID”
Dim mergedDataTable = (From row1 In dt1.AsEnumerable()
Join row2 In dt2.AsEnumerable()
On row1.Field(Of Integer)(“ID”) Equals row2.Field(Of Integer)(“ID”)
Select dt1.Clone().Rows.Add(row1.ItemArray.Concat(row2.ItemArray).ToArray())).CopyToDataTable()
if still the column names are identical. can you please try with the below code.
Dim query =
From e In dtEmployees.AsEnumerable()
Join s In dtSalaries.AsEnumerable()
On e.Field(Of String)(“EmployeeID”) Equals s.Field(Of String)(“EmployeeID”)
Select dtJoined.LoadDataRow(New Object() {
e(“EmployeeID”),
e(“Name”),
s(“Salary”)
}, False)