I have two datatables with same identity column. I want to update one column value in one table with other column value in another table. For example:
These are the two tables:
Table1:
ID Name Amount
------ ------- ---------
1 AA 0
2 BB 0
3 CC 0
Table2:
ID Amount
------ ---------
1 5000
2 6000
3 7000
My desired datatable should like this:
DesiredTable:
ID Name Amount
------ ------- ---------
1 AA 5000
2 BB 6000
3 CC 7000
I don’t want to use for loop. How to achieve this result using LINQ?
Here Consider Table1 as ‘DTTable1’ and Table2 as DTTable2: