DataTable merge without primary key column
How to merge tables in which destination table contains primary key column and source table doesnt contain. DataSet enforceConstraints is set to false then it will merge the table. but when execute GetChanges() on destination table exception occurs.
//Dest table contains primary key which is missing in source table
DataSet ds;
开发者_如何转开发 DataTable source;
ds.EnforceConstraints = false;
ds.Tables["Dest"].Merge(source,true,MissingSchemaAction.AddWithKey);
ds.Tables["Dest"].GetChanges();
Have tried to merge tables without primary key. I think its not possible.
精彩评论