"This row already belongs to another table" Error

 DataTable dataTableWithDifferences = comparer.Compare();               DataTable sourcetable  = GetData1();               DataTable destinationtable = GetData2();             var updateRecords = (from table1 in destinationtable.AsEnumerable()                                  join table2 in dataTableWithDifferences.AsEnumerable()                                  on (string)table1["UserID"] equals (string)table2["UserID"]                                  select table2);             DataTable dtUpdates = sourcetable.Clone();             updateRecords.ToList().ForEach(row => dtUpdates.ImportRow(row));

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Google+ photo

You are commenting using your Google+ account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )


Connecting to %s