dataset.writeXml(..) problem updating xml file

G

Guest

Hello,

I have an application using an xml dataset to store app and user settings.
The problem I am having is related to writexml. I have a save button on my
application that updates the dataset and then using the writexml(...)
function saves the dataset to an xml file. I have noticed that the file does
not change everytime I click the save button. I get no errors but the
writexml function does not seem to be updating the xml file.

private void but_SaveAndExit_Click(object sender, System.EventArgs e)
{
this.returnDataSet.AcceptChanges();
this.returnDataSet.WriteXml("settings.xml");
}

Seems like it updates sometimes but not everytime. Is there something I'm
missing, or has anyone seen this problem with dataset.writexml?

Thanks,
Wes
 
C

Chris, Master of All Things Insignificant

Shot in the dark, but are you looking at the file while your program is
still running? If yes, have you closed the file before looking at it? You
might not see the changes if you haven't closed your file. I'm not sure if
WriteXml handles this for you or not, never used it.

Chris
 
G

Guest

Nope not looking at the file. I am just looking at the file explorer in the
folder which contains the file to verify that the date modified is changing
when I make changes.
 
C

Chris, Master of All Things Insignificant

Are you exiting the program though?
Chris

Wes said:
Nope not looking at the file. I am just looking at the file explorer in
the
folder which contains the file to verify that the date modified is
changing
when I make changes.
 
G

Guest

I'm not viewing the xml file in any application. And in my past work with
writexml it will still write to the file if I'm viewing it in VS.net. But
regardless I am not looking at the file when this problem has occured.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top