This article describes you how to compare DataTables to get matched, unmatched, combine list of all rows in both tables.
You can use DataTable extension methods like Except to get matched DataRows, Intersect to get unmatched DataRows and Union to get unique combine list of DataRows from all DataTables.
- CompareDataTables/Program.cs - creates two different DataTables to hold data of Math and English student. It also have methods to find students who registered for both, only english, only math, and all students.
Following pic shows you all function
For more details on implementation click here