I am working on an application in VB.NET and MySql. I am getting a duplicate entry for key 1 error. My application goes through the following steps.
1. Populate my DataSet from the database.
2. Make changes in the DataSet
3. Write the DataSet into XML file using the following statement
4. Read the DataSet from the XML file (after restarting the application) using the following code
After populating the dataset from XML file, when i update it back in the database, i receive duplicate entry error (even if i have not added any record to the dataset after populating the dataset from xml file)
1. Populate my DataSet from the database.
2. Make changes in the DataSet
3. Write the DataSet into XML file using the following statement
Code:
ds.WriteXml("file1.xml", XmlWriteMode.WriteSchema)
Code:
ds.ReadXml("file1.xml", XmlReadMode.ReadSchema)
After populating the dataset from XML file, when i update it back in the database, i receive duplicate entry error (even if i have not added any record to the dataset after populating the dataset from xml file)
Comment