Sorry for the earlier post! i accidentally pressed the Post button.
Anyways , this is my question.

Just started off with .NET so bear with me if the question is silly.

I have a table say,

Create table Products(
ID primary key,
Name String

This table already has a few products.
I got the data in the XML format using DataSet.WriteXML();
I edited the XML file and added a few more products and modified the "name"
of some of the already existing products.

Now in another function, i tried doing a DataSet.ReadXML("the new xml");

I got a SQL Exception indicating that duplicate keys cannot be inserted when
i did a SqlAdapter.Update() and subsequent DataSet.AcceptChanges()

Is there anyway it can update the existing keys and add new ones automatically?
Looks like it is doing an insert for all the records read from the XML file
and hence throwing an exception.