Saving data as XML file on windows CE

G

Guest

We are developing an application that allows the user to input information
that is stored in a dataset while the application is running. What we are
looking to do is to write an XML file that contains the data from the
dataset, and not the schema of the dataset. I am lost here as all I can get
to work is an XML file creating the schema for the dataset, but not the
user's data.

Any suggestions?

Thanks
MD
 
C

chris-s

Have you looked at DataSet.WriteXML(), it's what we use and it seems to
work fine.

Cheers

Chris
 
G

Guest

Thanks Chris, I have and it writes the structure of the database but not the
data contained. I might be coding it wrong. Do you have a sample of how you
are using?

thanks
MD
 
G

Guest

I got the WriteXML to work when working with one table in the dataset, but
when I try to write all the tables in the dataset, I am getting nowhere. any
other ideas?
 
I

Ilya Tumanov [MS]

There's nothing special you need to do besides this:



ds.WriteXml("FileNameWithFullPathOnDevice.xml");



If you don't see data for other tables in XML, you don't have it in the data
set.



Another common mistake would be to look for saved file on the desktop if you're
using emulator.


Best regards,

Ilya

This posting is provided "AS IS" with no warranties, and confers no rights.

*** Want to find answers instantly? Here's how... ***

1. Go to
http://groups-beta.google.com/group/microsoft.public.dotnet.framework.compactframework?hl=en
2. Type your question in the text box near "Search this group" button.
3. Hit "Search this group" button.
4. Read answer(s).
 
G

Guest

This is how I got the appliation to do what I needed. In my dataset I have
three tables. I wrote each table to an xml file and stored in on the device
in a temp path. After each table was written, I then wrote a routine to take
the three files, make them one, and then delete the three temp files.

When loading the data, I just reverse the process, reading the one file, and
creating three temp XML files and then reading that into the dataset.

Thanks to all for your help both on and off the list
 
I

Ilya Tumanov [MS]

That's a complicated replacement for a single line of code. But it's fine as
long as it works for you.

Best regards,

Ilya

This posting is provided "AS IS" with no warranties, and confers no rights.

*** Want to find answers instantly? Here's how... ***

1. Go to
http://groups-beta.google.com/group/microsoft.public.dotnet.framework.compactframework?hl=en
2. Type your question in the text box near "Search this group" button.
3. Hit "Search this group" button.
4. Read answer(s).
 

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