开发者

datatable compare

I have a DataTable dtOld with records from database.

I have a DataTable dtNew with new records to be written to the database.

开发者_如何学Python

Can someone please help with the best way to send the new DataTable dtNew to the database without records that already exist in the dtOld DataTable?

thanks, rodchar


Rather than maintain two separate DataTables, it might be easier to use the technique demonstrated here:

http://msdn.microsoft.com/en-us/library/xzb1zw3x%28VS.80%29.aspx

You can use a DataAdapter to update the database with records that have a particular row state (added, for instance).

0

上一篇:

下一篇:

精彩评论

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

最新问答

问答排行榜