There are some articles already on the internet which deals in this area but personally they didn’t fit my requirement due to one reason or the other.
In order to proceed with this article, I will first create two DataTable and fill them up with some random data.
The DataTable would be like the following:
DataTable 1:


DataTable 2:


Now, we will use the below LINQ query to merge the DataTable in such a way that the output is as in the following:

The code for the same is as follows:

The simple query just finds the item from both the DataTables having the common “ID” in them and gets the same in a different DataTable all together.
The output screen is as follows:

Please feel free to download the attached project for more understanding of the concept.
Join the conversation! Your thoughts help the community grow.
Sign in to leave a comment
It is the same account you read, post and publish with — and you will come straight back to this page.

Bhuvanesh MohankumarPosted May 6, 2016, 3:57 PM
Good one...
pooja guptaPosted Aug 6, 2015, 1:30 AM
Nice article.
Santhakumar MunuswamyPosted Aug 5, 2015, 11:45 PM
Nice Article. Thanks for sharing
Neeraj KumarPosted Aug 5, 2015, 5:55 PM
Nice