1
Answer

Compare datatable and return rows with changes

Photo of Vignesh Kumar

Vignesh Kumar

10y
884
1
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)