XML in the compact framework

  • Thread starter Thread starter Taryon
  • Start date Start date
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!
 
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?
 
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?
 
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.
 
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.
 
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.
 
Back
Top