Vignesh Kumar

Vignesh Kumar

  • NA
  • 1k
  • 416.5k

Compare datatable and return rows with changes

Apr 24 2015 6:22 AM
Hi,

I am trying to compare two datatable and return rows which has changes by using the below code and it doesn't work. Pls suggest some options.

DataTable dt3 = new DataTable();

var contacts = dt1.AsEnumerable().Intersect(dt2.AsEnumerable(),DataRowComparer.Default);

foreach (DataRow rows in contacts)
{
   dt3
.Rows.Add(rows);
}

Answers (1)