rizwan6feb
Member
- Joined
- Aug 18, 2008
- Messages
- 8
- Programming Experience
- Beginner
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. Populates DataSet from the database.
2. Makes changes in the DataSet
3. Writes 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 only edit existing records)
How can i make sure that only the records which are added, modified or deleted should be updated in the database
1. Populates DataSet from the database.
2. Makes changes in the DataSet
3. Writes the DataSet into XML file using the following statement
VB.NET:
ds.getChanges().WriteXml("file1.xml", XmlWriteMode.WriteSchema)
4. Read the DataSet from the XML file (after restarting the application) using the following code
VB.NET:
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 only edit existing records)
How can i make sure that only the records which are added, modified or deleted should be updated in the database