Pops Fale

Pops Fale

  • NA
  • 538
  • 21.3k

compare 2 datatables using linq in c#

Jun 21 2016 3:38 AM
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)