473,396 Members | 1,827 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,396 software developers and data experts.

dataset.writeXml(..) problem updating xml file

Wes
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
Nov 16 '05 #1
4 2382
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

"Wes" <We*@discussions.microsoft.com> wrote in message
news:BD**********************************@microsof t.com...
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

Nov 16 '05 #2
Wes
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.

"Chris, Master of All Things Insignifican" wrote:
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

"Wes" <We*@discussions.microsoft.com> wrote in message
news:BD**********************************@microsof t.com...
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


Nov 16 '05 #3
Are you exiting the program though?
Chris

"Wes" <We*@discussions.microsoft.com> wrote in message
news:5D**********************************@microsof t.com...
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.

"Chris, Master of All Things Insignifican" wrote:
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

"Wes" <We*@discussions.microsoft.com> wrote in message
news:BD**********************************@microsof t.com...
> 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


Nov 16 '05 #4
Wes
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.

"Chris, Master of All Things Insignifican" wrote:
Are you exiting the program though?
Chris

"Wes" <We*@discussions.microsoft.com> wrote in message
news:5D**********************************@microsof t.com...
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.

"Chris, Master of All Things Insignifican" wrote:
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

"Wes" <We*@discussions.microsoft.com> wrote in message
news:BD**********************************@microsof t.com...
> 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


Nov 16 '05 #5

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

2
by: Pankaj Banga | last post by:
When we create a strongly typed dataset, three types of files get created ..xsd, .vb, and .xsx. The IDE only shows .xsd file. How can I show .vb file in solution explorer. Thanks
4
by: Deepa | last post by:
Hi I have a DataSet file (xml) which I need to convert it into a tab delimited file. I need to write a C# console application for doing the same. Can anyone help me out with the code to do it? I'd...
3
by: EMW | last post by:
My ASPX file is opened with two arguments, namely the Width and Height of the browser window. Since I've got more ASPX files, I need to keep these values. I was thinking of writing them in an XML...
4
by: D Witherspoon | last post by:
How do I add a dataset control to a ASP.NET 2005 app? It was easy in 2003. I would just drag a control onto the form. In an ASP.NET web project VS.2005 project the control doesnt seem to exist....
3
by: Asaf | last post by:
Hi, I have a MSSQL 2005 test DB with two tables: Table "T1Customers": T1CustomersRowEnum (PK, int, Not Null) T1CustomersFullName (nvarchar(50) null) Table "T2Details":
2
by: Steven Nagy | last post by:
Hey All, I have written a tool that generates XML for a dataset. You know when you add a dataset file to a project, you write the XML and the code gets generated automatically? Well I want this...
3
by: filip.norrgard | last post by:
Hi All! I've been developing an ASP.Net 2.0 web application using the Visual Studio 2005 tools. Currently datagrids on a page are filled with data from a dataset (a .xsd file in the "project")...
5
by: xarky1984 | last post by:
Hi, I am using Visual Studio 2005 and has a problem with DataSet Designer. While I was using Visual Studio, 'A Package Load Failure Error' was given. Visual Studio terminated and when...
4
by: =?Utf-8?B?anAybXNmdA==?= | last post by:
I've got a DataSet that I save as XML using the DataSet DataTable's WriteXml method. If I say XmlWriteMode.IgnoreSchema, it shows up great in Excel, but I can not reopen the file in my...
3
by: Gun Slinger | last post by:
Hi guys, I have run into a little problem once again in my program. I have struggled with this for a while looking around for answers, and have made a make shift method to do a work around. But...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.