I have 2 datatable
DataTable1
SNo
1
2
3
4
DataTable2
SNo
1
4
3
I want the result
DataTableResult
SNo
2
I can do it using for loop.
But I am trying to do it using linq.
var intersection = DataTable1.AsEnumerable().Intersect(DataTable2.AsEnumerable(), DataRowComparer.Default);
Then I found out Intersect is will give u the rows where both tables have.
I dunno exactly what function to use.
Any ideas?
I have got the answer.
Thanks to the person who deleted the answer.
But that gives me a start.
The answer is
var intersection = DataTable1.AsEnumerable().Except(DataTable2.AsEnumerable(), DataRowComparer.Default);
you can try using exept statement it aliitle hard to be precise since you only show the table as structure but you can try somethink like this