reading xml file

G

Guest

I'm trying to read an xml file into a dataset just like I do in my windows
application.

DataSet.ReadXML("filename.xml");

But no matter how I have the string file name the application errors and I
get File Not Found when I debug on the emulator. Since I'm fairly new to
mobile development, do I need to do anything in particular to load the xml
file to the emulator / device? The xml file is in the project folder.
 
M

Michael Nemtsev

Hello RR,

Just check for the file existed with File.Exist before reading
BTW, I recomend to use ReadXmlSchema before reading XML, because in that
case CLR is not requred to reconstruct DOM for the xml, and this dosn't hinder
performance

R> I'm trying to read an xml file into a dataset just like I do in my
R> windows application.
R>
R> DataSet.ReadXML("filename.xml");
R>
R> But no matter how I have the string file name the application errors
R> and I get File Not Found when I debug on the emulator. Since I'm
R> fairly new to mobile development, do I need to do anything in
R> particular to load the xml file to the emulator / device? The xml
R> file is in the project folder.
R>
---
WBR,
Michael Nemtsev :: blog: http://spaces.msn.com/laflour

"At times one remains faithful to a cause only because its opponents do not
cease to be insipid." (c) Friedrich Nietzsch
 
G

Guest

Try using Application.StartupPath to prefix the filename. The StartupPath
property is the path (minus filename) for the executable. Regardless, it
sounds like a path issue moreso than a mobile app issue.
 

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