M
Miro
If I am creating a dummy app and want to store some user settings is there
any harm in this:
(This program will be used only by 1 person at a time)
I create a dataset in the dataset designer,
Then during the 'run' of the application I check to see if the xml file
exists. If not, I create it with the XMLwrite.
Example: MySettingsDataset.WriteXml("MyData.xml",
XmlWriteMode.IgnoreSchema)
Then when the form loads, I always load the whole XML file into my dataset
as such:
MySettingsDataset.ReadXml("MyData.xml" )
From here on in the app runs off the settings in the dataset. If at anytime
a user pulls up a screen ( that allows the editing of the settings), they
hit save, and I write the whole dataset back to the XML.
It is my first attempt at using xml files. In this case since I designed
the XML file in the dataset designer, I am assuming I do not need to include
the schema, or even do something like this:
Dim xDataFromDataset As Xml.XmlDataDocument
xDataFromDataset = New Xml.XmlDataDocument(MySettingsDataset)
xDataFromDataset.Load("MyData.xml")
Because each time I am assuming I am always overwriting ALL of the xml file.
Am I correct in this simple example assumption?
Thanks,
Miro
any harm in this:
(This program will be used only by 1 person at a time)
I create a dataset in the dataset designer,
Then during the 'run' of the application I check to see if the xml file
exists. If not, I create it with the XMLwrite.
Example: MySettingsDataset.WriteXml("MyData.xml",
XmlWriteMode.IgnoreSchema)
Then when the form loads, I always load the whole XML file into my dataset
as such:
MySettingsDataset.ReadXml("MyData.xml" )
From here on in the app runs off the settings in the dataset. If at anytime
a user pulls up a screen ( that allows the editing of the settings), they
hit save, and I write the whole dataset back to the XML.
It is my first attempt at using xml files. In this case since I designed
the XML file in the dataset designer, I am assuming I do not need to include
the schema, or even do something like this:
Dim xDataFromDataset As Xml.XmlDataDocument
xDataFromDataset = New Xml.XmlDataDocument(MySettingsDataset)
xDataFromDataset.Load("MyData.xml")
Because each time I am assuming I am always overwriting ALL of the xml file.
Am I correct in this simple example assumption?
Thanks,
Miro