Copy one column values from one datatable to another datatable

Hi ,

I have to copy the specific column data from one datatable to another datatable.

For example

dt1 looks
image

and dt2 Looks

image

Now i want move the values from dt2 Name column to dt1 Name column, How to achieve this.

hey,
you can use join data tables:

But in your case you don’t have primary key.
How do you know on which row what name should be entered?

@Chandramouli_Vidavalapati

Check below for your reference

Hope this may help you

Thanks

Hi!

please follow the below steps

1.Excel Application inside that Read Range from Excel output as dt1.
2.Take one more Read Range from excel output as dt2.
3.Take one for each row in data table. Read first dt1.
4.Take one Build Data table and create the 3 columns like this sno,Name,Country output as BuildDt
take 2 assign activities
1. Sno=CurrentRow(“s.no”).ToString
2. Country=CurrentRow(“Country”).ToString
5.Take one more for each in data table and read dt2.
take one assign Name=CurrentRow2(“Name”).ToString
Take one Add data row activity->Properties ArrayofRow pass the values like this

{Sno,Name,Country} and mention dt as BuildDt.

Outside the all for each rows

Take one Excel Application Scope
Write range from Excel output as BuildDt

save and run

Regards,
NaNi

Thanks Nani, That works.

Regards,
Mouli

1 Like

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