Click here to Skip to main content
15,886,724 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
I have 2 datatables each containing 100 datarows each. in these 2 datatables 20 rows are common (exist in both data tables). When i merge these 2 datatables how i can eleminate the duplicate datarows without effecting the performance because the datarows in the datatables might increase in future.

thanks in advance
Posted

try like this
DataSet ds=new DataSet();
ds.Tables.Add(Table1);
ds.Tables.Add(Table2);
ds.Relations.Add("TheRelation", Table1.Columns["a"], Table2.Columns["a"]);
Table2.Columns.Add("b", GetType(System.String), "Parent.b")

and see below link you may get an idea
http://stackoverflow.com/questions/1262383/merging-2-data-tables-in-vb-net[^]
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900