G
Guest
Hi
I have been reading Core Reference ADO.NET by David Sceppa, a book by MSPress, and had found what I thought was the solution to a problem I have. I am referring to figure 11-8 where two DataTables share the same primary key (say an identity) but have different columns. According to the book, merging these two would result in a change in the number of columns of the receiving DataTable (now the union of each table's columns) -- this much works -- but ALSO, there would be a true merging (not a simple AddRow) according to which rows from the different tables would be matched into a SINGLE row in the destination, with the values of the columns set from the corresponding table
And yet, I cann't get it to work
A brief snippet may show my error
DataSet ds = new DataSet("Mine")
foreach( DataTable table in tables
table.TableName = "PERSONS"
ds.Merge( table, true, MissingSchemaAction.Add)
here tables contains the two tables that have same primary key but different columns
Please help
Juan Den
I have been reading Core Reference ADO.NET by David Sceppa, a book by MSPress, and had found what I thought was the solution to a problem I have. I am referring to figure 11-8 where two DataTables share the same primary key (say an identity) but have different columns. According to the book, merging these two would result in a change in the number of columns of the receiving DataTable (now the union of each table's columns) -- this much works -- but ALSO, there would be a true merging (not a simple AddRow) according to which rows from the different tables would be matched into a SINGLE row in the destination, with the values of the columns set from the corresponding table
And yet, I cann't get it to work
A brief snippet may show my error
DataSet ds = new DataSet("Mine")
foreach( DataTable table in tables
table.TableName = "PERSONS"
ds.Merge( table, true, MissingSchemaAction.Add)
here tables contains the two tables that have same primary key but different columns
Please help
Juan Den