XML in the compact framework

T

Taryon

Hi all!
im seeing in the worst way the differences reading xml files between compact
and normal framework.
DataSet ds = new DataSet();
ds.ReadXml("file.xml");
is not working.
Where can i find some examples about mobile programming? not wap or asp.net
but like windows form ok?
thx in advance!
 
G

Guest

that should work - as long as "file.xml" exists. Use File.Exists (in System.IO) to check it. if that's not it, then what error do you get?
 
T

Taryon

The error is file do not exists. but the file is there, in the emulator,
together with the application.
i put the file in the folder /bin/debug to avoid problems with "where is the
file".

Lawrence Anstey said:
that should work - as long as "file.xml" exists. Use File.Exists (in
System.IO) to check it. if that's not it, then what error do you get?
 
J

Jon Skeet [C# MVP]

Taryon said:
The error is file do not exists. but the file is there, in the emulator,
together with the application.
i put the file in the folder /bin/debug to avoid problems with "where is the
file".

Ah - that assumes that the framework is going to be trying to read by
default in the same directory as the file. It might, but I don't know
for sure... I suggest you write something (just a test app) which
*writes* to the same filename, and then see where it ends up on the
device.
 
T

Taryon

cool! i like that!
thx

Jon Skeet said:
Ah - that assumes that the framework is going to be trying to read by
default in the same directory as the file. It might, but I don't know
for sure... I suggest you write something (just a test app) which
*writes* to the same filename, and then see where it ends up on the
device.
 
D

Dan Fergus

In the CF, if no path is specified it tries to open from the My Device root.
You need to always specify a path unless you keep all of your files in the
device root. And don't even try relative paths, thos don;t work either.

Rule #1 : Always specifiy path on a file name.
 

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