Compare 2 datatables using linq

How do i use linq to compare 2 datatables, output the differences of the rows?
As long as there is any differences in the row, it will be counted as different.

e.g.
1

Also how do i compare to get the missing rows from dt 1 which is not in dt 2 (based on ID)

Im currently using loops, but its too much loops.

Use this below linq , @Username95
dt1.AsEnumerable().Except(dt2.AsEnumerable(),System.Data.DataRowComparer.Default).CopyToDataTable

Hope this may help you :slight_smile:

Hi, does this output the differences? Will the number of columns per data table affect the output?

No @Username95
Use the above code and let me know :slight_smile:

Hi it does output. But when added in an additional row in dt 2, every row becomes different