XML File in Windows Mobile

How To find a Xml File in windows Mobile SDK 6.0

Page 1 of 1

6 Replies - 5150 Views - Last Post: 14 September 2009 - 08:48 PM

#1 kkapilchoubisa  Icon User is offline

  • New D.I.C Head

Reputation: 0
  • View blog
  • Posts: 7
  • Joined: 07-September 09

XML File in Windows Mobile

Post icon  Posted 08 September 2009 - 09:33 PM

I m new in developing windows mobile.
I am facing a problem to getting a xml file in code.

I have a XML file named trial.xml in the same folder where the application's executable exist.

Iused the following Code
XmlDocument xd = new XmlDocument();
xd.Load("trial.xml");


It does not worked then I used
xd.Load("trial.xml");
XmlTextReader reader = new XmlTextReader("trial.xml");
XmlNodeList nodelst;
nodelst = XmlDoc.GetElementsByTagName("detail");


It also not worked.
There is a error Occurs that directory or file not found.

Can anybody give me the solution of this Problem.


I hope you will help me.

Thanx in Advance

Is This A Good Question/Topic? 0
  • +

Replies To: XML File in Windows Mobile

#2 eclipsed4utoo  Icon User is offline

  • Not Your Ordinary Programmer
  • member icon

Reputation: 1524
  • View blog
  • Posts: 5,958
  • Joined: 21-March 08

Re: XML File in Windows Mobile

Posted 09 September 2009 - 08:33 AM

you may have to give it the full path to the file...even if it is in the same directory as the application.
Was This Post Helpful? 0
  • +
  • -

#3 kkapilchoubisa  Icon User is offline

  • New D.I.C Head

Reputation: 0
  • View blog
  • Posts: 7
  • Joined: 07-September 09

Re: XML File in Windows Mobile

Posted 11 September 2009 - 01:12 AM

Yes I got it. Thanx but not by the writting full path. Thanx eclipsed4utoo for trying to help me. But it is Windows Mobile application so it works differently with the Windows application.
Was This Post Helpful? 0
  • +
  • -

#4 BrianKuo  Icon User is offline

  • New D.I.C Head

Reputation: 1
  • View blog
  • Posts: 2
  • Joined: 14-September 09

Re: XML File in Windows Mobile

Posted 14 September 2009 - 12:37 AM

View Postkkapilchoubisa, on 8 Sep, 2009 - 08:33 PM, said:

I m new in developing windows mobile.
I am facing a problem to getting a xml file in code.

I have a XML file named trial.xml in the same folder where the application's executable exist.

Iused the following Code
XmlDocument xd = new XmlDocument();
xd.Load("trial.xml");


It does not worked then I used
xd.Load("trial.xml");
XmlTextReader reader = new XmlTextReader("trial.xml");
XmlNodeList nodelst;
nodelst = XmlDoc.GetElementsByTagName("detail");


It also not worked.
There is a error Occurs that directory or file not found.

Can anybody give me the solution of this Problem.


I hope you will help me.

Thanx in Advance



Hi~ kkapilchoubisa,

you may try to use "@"before your path..
for example, (@"\Storage Card\XmlFile.xml");
or
use Path.Combine to get full path.
for example,
XmlFilePath = Path.Combine(UI_Common.ProjectInfo_Parameters.SG_Parameter_ProjectFolderPath, UI_Common.ProjectInfo_Parameters.SG_Parameter_ProjectName) + @"\MainXML.xml"

As you know, Mobile programming is different to Windows system. If you are using Visual Studio 2005/2008, you can setup it which support to use Storage Card and you can set the storage path on your HardDisk.

I hope it can help you to fix your problem. ^^

Best regards,
BrianKuo from Taiwan
Was This Post Helpful? 1
  • +
  • -

#5 kkapilchoubisa  Icon User is offline

  • New D.I.C Head

Reputation: 0
  • View blog
  • Posts: 7
  • Joined: 07-September 09

Re: XML File in Windows Mobile

Posted 14 September 2009 - 05:04 AM

Thanxxxx
for replying me. But I already got it. :^:
Yeh I was facing problems in it. but now I got it by
xdoc.load( "\\Storage Card\\trial.xml");


Thanx for your suggestion.
Was This Post Helpful? 0
  • +
  • -

#6 eclipsed4utoo  Icon User is offline

  • Not Your Ordinary Programmer
  • member icon

Reputation: 1524
  • View blog
  • Posts: 5,958
  • Joined: 21-March 08

Re: XML File in Windows Mobile

Posted 14 September 2009 - 06:16 AM

View Postkkapilchoubisa, on 14 Sep, 2009 - 08:04 AM, said:

Thanxxxx
for replying me. But I already got it. :^:
Yeh I was facing problems in it. but now I got it by
xdoc.load( "\\Storage Card\\trial.xml");


Thanx for your suggestion.


just so you know...that's the full path to the file.
Was This Post Helpful? 0
  • +
  • -

#7 BrianKuo  Icon User is offline

  • New D.I.C Head

Reputation: 1
  • View blog
  • Posts: 2
  • Joined: 14-September 09

Re: XML File in Windows Mobile

Posted 14 September 2009 - 08:48 PM

Anyway, I am glad to hear you fixed it already.

have a nice day to all of you.


Brian
Was This Post Helpful? 0
  • +
  • -

Page 1 of 1