JaedenRuiner
Well-known member
- Joined
- Aug 13, 2007
- Messages
- 340
- Programming Experience
- 10+
I've created a DataSet for use of storing application preferences, with the thought that I would preserve user settings in an xml file, and since the DataSet can import/export XML quite effectively I decided to use that. However, I'm getting a ConstraintException when I try to reload the export.
So i'm basically setting the data and exporting it to the file but on the read it says I'm violating some constraint issues. I have noticed that one of my fields is an expression field (not a persistent value) basing a computation off another Column's value. I'm wondering that since the column is Expression based, it is ReadOnly, and thus might be the cause of the constraint issue. That, as well as the ID fields for each of my tables are Auto Increment, which makes me wonder if they might be confused by the reading of the data from the xml file.
Is there a way to resolve this either by:
Thanks
VB.NET:
xw as XmlWriter
PreferencesDS.WriteXML(xw, IgnoreSchema)
VB.NET:
PreferencesDS.ReadXML("default.xml", IgnoreSchema)
So i'm basically setting the data and exporting it to the file but on the read it says I'm violating some constraint issues. I have noticed that one of my fields is an expression field (not a persistent value) basing a computation off another Column's value. I'm wondering that since the column is Expression based, it is ReadOnly, and thus might be the cause of the constraint issue. That, as well as the ID fields for each of my tables are Auto Increment, which makes me wonder if they might be confused by the reading of the data from the xml file.
Is there a way to resolve this either by:
- Determining the cause of the ConstraintViolation and ignoring it
- Preventing certain Column/Fields from being written in the initial export (case and point the Expression column as it is not necessary to save.)
Thanks