Reputation: 15423
I have a DataTable dtOld with records from database.
I have a DataTable dtNew with new records to be written to the database.
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
Upvotes: 0
Views: 383
Reputation: 12499
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).
Upvotes: 1