3
Answers

compare 2 datatables using linq in c#

Pops Fale

Pops Fale

8y
7.9k
1
i want to compare 2 datatables in which it first check for primary key , and then check for another changes in row, below code works without primary key how can i use primary key in bellow code ?
 
DataTable Final = dt1.AsEnumerable().Except(dt2.AsEnumerable(), DataRowComparer.Default).CopyToDataTable();
Answers (3)