I have a dataset with two datatables dt1 and dt2, dt1 have one row and dt2 have more than one rows,. Both the data tables have colums[BILLNO], I want to add all the rows of dt2 to dt1, if dt1 does not contain that bill no which exists in dt2. Please help me to loop through the tables and add those table rows to other table. If anyone have any suggested links please specify. Thank you.
Loading
Ganesan CPosted Aug 14, 2021, 4:07 PM
Hi,
If your both two tables has same primary key then simply merge as follows,
DataTable dt = dt1.Merge(dt2);
Otherwise you can use as follows,
Sachin SinghPosted Aug 13, 2021, 7:57 PM