I want to compare two datatables, get the mismatched records using LINQ query. Please help me
Check this post: How to see which item is different when comparing two datatables
@qbss Mismatched records from 1 datatable or both Datatables ?
Get rows that exists in dtTable1 but not in dtTable2
dtDifference= dtTable1.AsEnumerable().Except(dtTable2.AsEnumerable, DataRowComparer.Default).CopyToDataTable
Get rows that exists in dtTable2 but not in dtTable1
dtDifference= dtTable2.AsEnumerable().Except(dtTable1.AsEnumerable, DataRowComparer.Default).CopyToDataTable
Hope this helps. Let me know if it doesn’t.
one data table
This topic was automatically closed 3 days after the last reply. New replies are no longer allowed.