Author: NickG4 | Posted on: 7/30/2010 3:51:52 PM | Views : 296

I need to compare 2 DataTables that do not necessarily have the same structure.  One dataTable is the master (dtDB), the second dataTable (dtFORM) is what will have the changes, if any, but not necessarily all of the columns of dtDB.  In both tables the first column will be the primary key and all columns that dtFORM has, dtDB will have.


There is another DataTable (dtResults) that will flag the differences


This is where I am at so far:

const string rowNew = "newRow", rowChanged = "changedRow"; //first col of each DataTable is the PK DataTable dtResult = new DataTable(); dtResult = dtDB.Copy(); //add the flag columns DataColumn col0 = new DataColumn(rowNew); DataColumn col1 = new DataColumn(rowChanged); dtResult.Columns.Add(c ...

Go to the complete details ...