开发者

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.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜