Click here to Skip to main content
15,795,581 members
Please Sign up or sign in to vote.
1.00/5 (1 vote)
See more:

I have taken two tables and used "dt.Merge(dt1);" to merge the tables. The tables columns are merging fine but the values in the second table are not coming beside the first table, the values are coming after the last row of first table.

Updated 31-Jan-13 12:40pm
Sergey Alexandrovich Kryukov 31-Jan-13 18:33pm    
First question you have to ask yourself, how come you got tables which needs merge? Also, what do you mean by "tables"? If it's a database, it might not have certain order; the order only appears as a result of query...

1 solution

Add new columns in datatable1

And for each row in datatable 2, get the common column and values and update the existing datatable new columns with the values.
Share this answer
vinodkumarnie 1-Feb-13 5:34am    
which table you want to merge..?

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