Merge 2 datatables into a new one with only values of first column row wise, (Not side by side)

there are two datables as below:

dt1:
image

dt2:

image

Newdatatable dt3 should look like this:

image

Thankyou !

@ayushi_jain3

Follow the steps

  1. Assign Dt2.Columns(0).ColumnName = "Col1"
  2. Merge datatable dt1 and dt2
  3. Filter datatable and in column tab select keep and give "Col1"
  4. Use finaldt.Columns(0).ColumnName = "Col8"

Cheers

@ayushi_jain3

take two assign activities

dt1.DefaultView.ToTable(False,“Col1”)

dt2.DefaultView.ToTable(False,“Col5”)

dt1.AsEnumerable.Concat(dt2.AsEnumerable).CopyToDataTable

1 Like

@ayushi_jain3

you can also use this

assign

dt1.DefaultView.ToTable(false,“Col1”).AsEnumerable.Concat(dt2.DefaultView.ToTable(false,“Col5”).AsEnumerable).CopyToDataTable

This topic was automatically closed 3 days after the last reply. New replies are no longer allowed.