Add column in datatable

i want to add column in datatable(dt)
that column will be picked from another datatable(Dtt)

Do you mean the column and all its data for existent matching rows?

Column with all data

if the second datatable has the same number of rows, you can first add the column to the first datatable using the activity add data column, and after, use a for each row to add the values into the new column, let me know if you need help implementing this.

Hi @Ananya1

Basically you need to do following things

Create a variable with System.Data.DataColumn datatype - col1
Pass the index of you column like dt.Columns(index) to this variable - col1 = dt.Columns(0)
Then use add datacolumn activity and pass the column variable


Please mark as a solution if you found this useful :slight_smile:

Hi, this could never work for 2 reasons:

  1. You cant assign column of a datatable to add into another, you would get an error
  2. The data would not come as well
1 Like