Windows CE & Pocket PC

Moderators: None (Apply to moderate this forum)
Number of threads: 324
Number of posts: 425

This Forum Only
Post New Thread
Single Post View       Linear View       Threaded View      f

Report
How to load xml document? Posted by mufantasy on 26 Jan 2007 at 9:51 AM
Hi everybody.

I'm using VS2005 C# to code a smart device project, which should run in Pocket PC 2003 SE emulator. When I try to load a xml document as in this sample

private void Display()
{
try
{
XmlDocument doc = new XmlDocument();
string url = @"D:\NewFolder\Notebook\Notebook\Xml\diary.xml";
doc.Load(url);
DateTime t = dateTimePicker1.Value;
string date = Convert.ToString(t.Day) + "/" + Convert.ToString(t.Month) + "/" + Convert.ToString(t.Year);
XmlNode node = doc.SelectSingleNode("diary[@date = " + date + "]");
textBox1.Text = node.Value;
}
catch (System.IO.FileNotFoundException e)
{
MessageBox.Show(e.Message);
}

A problem occurred like this :

A first chance exception of type 'System.IO.FileNotFoundException' occurred in mscorlib.dll
A first chance exception of type 'System.IO.FileNotFoundException' occurred in mscorlib.dll
A first chance exception of type 'System.IO.DirectoryNotFoundException' occurred in mscorlib.dll
A first chance exception of type 'System.IO.DirectoryNotFoundException' occurred in System.Xml.dll

I presume that the emulator doesn't know the path (url) on PC, but I don't
know how to correct.

Can someone guide me how to correct this problem?
Thank you so much in advance.

Report
Re: How to load xml document? Posted by Ptr_082004 on 28 Jan 2007 at 9:52 AM
: Hi everybody.
:
: I'm using VS2005 C# to code a smart device project, which should run in Pocket PC 2003 SE emulator. When I try to load a xml document as in this sample
:
: private void Display()
: {
: try
: {
: XmlDocument doc = new XmlDocument();
: string url = @"D:\NewFolder\Notebook\Notebook\Xml\diary.xml";
: doc.Load(url);
: DateTime t = dateTimePicker1.Value;
: string date = Convert.ToString(t.Day) + "/" + Convert.ToString(t.Month) + "/" + Convert.ToString(t.Year);
: XmlNode node = doc.SelectSingleNode("diary[@date = " + date + "]");
: textBox1.Text = node.Value;
: }
: catch (System.IO.FileNotFoundException e)
: {
: MessageBox.Show(e.Message);
: }
:
: A problem occurred like this :
:
: A first chance exception of type 'System.IO.FileNotFoundException' occurred in mscorlib.dll
: A first chance exception of type 'System.IO.FileNotFoundException' occurred in mscorlib.dll
: A first chance exception of type 'System.IO.DirectoryNotFoundException' occurred in mscorlib.dll
: A first chance exception of type 'System.IO.DirectoryNotFoundException' occurred in System.Xml.dll
:
: I presume that the emulator doesn't know the path (url) on PC, but I don't
: know how to correct.
:
: Can someone guide me how to correct this problem?
: Thank you so much in advance.
:
:


If your emulator allows it, try mounting the folder that contains your XML doc as a flash memory device on the emulator and change the path to match it. I don't know if that would work for Pocket PC 2003 emulator, but it works on a WM 5 emulator
Report
Re: How to load xml document? Posted by mufantasy on 29 Jan 2007 at 12:40 AM
: : Hi everybody.
: :
: : I'm using VS2005 C# to code a smart device project, which should run in Pocket PC 2003 SE emulator. When I try to load a xml document as in this sample
: :
: : private void Display()
: : {
: : try
: : {
: : XmlDocument doc = new XmlDocument();
: : string url = @"D:\NewFolder\Notebook\Notebook\Xml\diary.xml";
: : doc.Load(url);
: : DateTime t = dateTimePicker1.Value;
: : string date = Convert.ToString(t.Day) + "/" + Convert.ToString(t.Month) + "/" + Convert.ToString(t.Year);
: : XmlNode node = doc.SelectSingleNode("diary[@date = " + date + "]");
: : textBox1.Text = node.Value;
: : }
: : catch (System.IO.FileNotFoundException e)
: : {
: : MessageBox.Show(e.Message);
: : }
: :
: : A problem occurred like this :
: :
: : A first chance exception of type 'System.IO.FileNotFoundException' occurred in mscorlib.dll
: : A first chance exception of type 'System.IO.FileNotFoundException' occurred in mscorlib.dll
: : A first chance exception of type 'System.IO.DirectoryNotFoundException' occurred in mscorlib.dll
: : A first chance exception of type 'System.IO.DirectoryNotFoundException' occurred in System.Xml.dll
: :
: : I presume that the emulator doesn't know the path (url) on PC, but I don't
: : know how to correct.
: :
: : Can someone guide me how to correct this problem?
: : Thank you so much in advance.
: :
: :
:
:
: If your emulator allows it, try mounting the folder that contains your XML doc as a flash memory device on the emulator and change the path to match it. I don't know if that would work for Pocket PC 2003 emulator, but it works on a WM 5 emulator
:
Thank you. It works



 

Recent Jobs

Official Programmer's Heaven Blogs
Web Hosting | Browser and Social Games | Gadgets

Popular resources on Programmersheaven.com
Assembly | Basic | C | C# | C++ | Delphi | Flash | Java | JavaScript | Pascal | Perl | PHP | Python | Ruby | Visual Basic
© Copyright 2011 Programmersheaven.com - All rights reserved.
Reproduction in whole or in part, in any form or medium without express written permission is prohibited.
Violators of this policy may be subject to legal action. Please read our Terms Of Use and Privacy Statement for more information.
Operated by CommunityHeaven, a BootstrapLabs company.