I have this code which compares data from two data tables. It does this by using a primary column and inserting the new record from table2 to table1. This loop continues for a large number of tables. I want to optimize it. Kindly give suggestions.
foreach (DataRow drRow in table2.Rows)
{
if(!table1.Rows.Contains(drRow["KeyId"]))
{
table1.ImportRow(drRow);
}
}