I have two DataTable with same schema and very similar data. One has data from web service, second from local XML file (data saved from last session).
What I want to do is:
- Merge() new data from service and old data from file
- GetChanges() to see which data has change since last session.
- Perform action for all new, modified and deleted rows.
- Save data to file.
I have problem in step one. When I merge two DataTable, I got exception that primary key already exists in DataTable. This is not behavior I need. In this case DataRow should be updated, not added.
Mayby someone know easy way to solve this problem. Thanks a lot.