473,472 Members | 1,727 Online
Bytes | Software Development & Data Engineering Community
Create Post

Home Posts Topics Members FAQ

Pocket PC

Hello,

I am a beginner in Pocket PC development.
I am trying to load an xml into a treeview control of pocket pc.
Its throwing an exception "Directory not found"
But the same piece of code is working in .NET regular environment not Pocket
pc.

For pocket PC is there any other library i should import to refer the xml
object?.

Below is the code snippet i am using.
Can any one help me?
Any help is highly appreciated.

Thanks
Siva

'**************************Code Snippet **********************
Imports System.Xml


Private Sub cmdLoadXML_Click(ByVal sender As System.Object, ByVal e As
System.EventArgs) Handles cmdLoadXML.Click
Dim xmldocTest As New XmlDocument

Try

xmldocTest.Load("C:\My DotNet\abc.xml")
(The exception is triggered on this line)

DisplayXmlNode(xmldocTest, tvwLoadXML.Nodes)

' Expand the root node.
tvwLoadXML.Nodes(0).Expand()

Catch GetError As System.Exception
MessageBox.Show(GetError.Message)
End Try

End Sub

'**************************Code Snippet Ends**********************
Nov 20 '05 #1
5 2638
Hello,

"Sivaprasad" <ss********@hotmail.com> schrieb:
I am a beginner in Pocket PC development.
I am trying to load an xml into a treeview control of pocket pc.
Its throwing an exception "Directory not found"
But the same piece of code is working in .NET regular
environment not Pocket


The code should work, the 'Load' method is even supported in the Compact
Framework (see [1]). Are you sure the file exists? What does 'File.Exists'
[2] return for the filename?

[1]
http://msdn.microsoft.com/library/de...sloadtopic.asp
[2]
http://msdn.microsoft.com/library/de...xiststopic.asp

--
Herfried K. Wagner
MVP · VB Classic, VB.NET
http://www.mvps.org/dotnet
Nov 20 '05 #2
There is no C:\ drive on a PDA. Typically, you'd use something like
"\Storage Card\Somefile.xml" or "My Documents\..." The file system is one
of the most radical differences between desktop and PDA apps. If you don't
have it yet, The .NET Compact Framework Core Reference by MS Press is a Must
Have, and Dan Fergus and Larry Roof have a book from APress coming out any
day now...it's over 1000 pages and you'll want to pick it up too.

HTH

Bill
"Sivaprasad" <ss********@hotmail.com> wrote in message
news:uF**************@TK2MSFTNGP09.phx.gbl...
Hello,

I am a beginner in Pocket PC development.
I am trying to load an xml into a treeview control of pocket pc.
Its throwing an exception "Directory not found"
But the same piece of code is working in .NET regular environment not Pocket pc.

For pocket PC is there any other library i should import to refer the xml
object?.

Below is the code snippet i am using.
Can any one help me?
Any help is highly appreciated.

Thanks
Siva

'**************************Code Snippet **********************
Imports System.Xml


Private Sub cmdLoadXML_Click(ByVal sender As System.Object, ByVal e As
System.EventArgs) Handles cmdLoadXML.Click
Dim xmldocTest As New XmlDocument

Try

xmldocTest.Load("C:\My DotNet\abc.xml")
(The exception is triggered on this line)

DisplayXmlNode(xmldocTest, tvwLoadXML.Nodes)

' Expand the root node.
tvwLoadXML.Nodes(0).Expand()

Catch GetError As System.Exception
MessageBox.Show(GetError.Message)
End Try

End Sub

'**************************Code Snippet Ends**********************

Nov 20 '05 #3
Hello Herfried,

Yah the file exists.
I ran the same code in regular one it works.
I added this piece of code in both the environment
'****

Import system.IO

if File.exists("C:\My Dotnet\abc.xml") then

endif

'****
It returns true in regular but in Compact framwork it returns false value.
Why? is it something to do with the path.
I tried putting the file in root, thinking that, it is something to do with
the space in the path and Compact frameweork may have problem in it. But
still File.exists returns false.

Thanks
Siva


"Herfried K. Wagner [MVP]" <hi*******@m.activevb.de> wrote in message
news:um**************@TK2MSFTNGP11.phx.gbl...
Hello,

"Sivaprasad" <ss********@hotmail.com> schrieb:
I am a beginner in Pocket PC development.
I am trying to load an xml into a treeview control of pocket pc.
Its throwing an exception "Directory not found"
But the same piece of code is working in .NET regular
environment not Pocket
The code should work, the 'Load' method is even supported in the Compact
Framework (see [1]). Are you sure the file exists? What does

'File.Exists' [2] return for the filename?

[1]
http://msdn.microsoft.com/library/de...sloadtopic.asp [2]
http://msdn.microsoft.com/library/de...xiststopic.asp
--
Herfried K. Wagner
MVP · VB Classic, VB.NET
http://www.mvps.org/dotnet

Nov 20 '05 #4
See my other post...there's no C:\ on the PDA, but there is on the desktop.

In general, as a design guildeline, Use an Assertion before you refernece
the file to make sure it exists.

Debug.Assert(File.Exists("C:\Whatever"), "Doesn't Exist)

It's the same as an if block in some regards, but you'll know it blew up
immediately and where it blew up.
This is a typical find in C#
@"Storage Card\License.xml"; in VB.NET it'd be "Storage Card\License.xml"

Cheers,

Bill
"Sivaprasad" <ss********@hotmail.com> wrote in message
news:uh*************@TK2MSFTNGP12.phx.gbl...
Hello Herfried,

Yah the file exists.
I ran the same code in regular one it works.
I added this piece of code in both the environment
'****

Import system.IO

if File.exists("C:\My Dotnet\abc.xml") then

endif

'****
It returns true in regular but in Compact framwork it returns false value.
Why? is it something to do with the path.
I tried putting the file in root, thinking that, it is something to do with the space in the path and Compact frameweork may have problem in it. But
still File.exists returns false.

Thanks
Siva


"Herfried K. Wagner [MVP]" <hi*******@m.activevb.de> wrote in message
news:um**************@TK2MSFTNGP11.phx.gbl...
Hello,

"Sivaprasad" <ss********@hotmail.com> schrieb:
I am a beginner in Pocket PC development.
I am trying to load an xml into a treeview control of pocket pc.
Its throwing an exception "Directory not found"
But the same piece of code is working in .NET regular
environment not Pocket


The code should work, the 'Load' method is even supported in the Compact
Framework (see [1]). Are you sure the file exists? What does

'File.Exists'
[2] return for the filename?

[1]

http://msdn.microsoft.com/library/de...sloadtopic.asp
[2]

http://msdn.microsoft.com/library/de...xiststopic.asp

--
Herfried K. Wagner
MVP · VB Classic, VB.NET
http://www.mvps.org/dotnet


Nov 20 '05 #5
Thanks Ryan

So how do i make it work now.
Should i copy the file to My Documents?
I did that too.
I copied the file to My Documents. Still it didn't work.
I tried all these combinations of paths
"My Documents\Thoughts.xml"
"\My Documents\Thoughts.xml"
"C:\document and settings\abc\My Documents\Thoughts.xml" 'Which, as u said
won't work any way"
Same result.

Please help
Siva

"William Ryan" <do********@comcast.nospam.net> wrote in message
news:eo*************@tk2msftngp13.phx.gbl...
There is no C:\ drive on a PDA. Typically, you'd use something like
"\Storage Card\Somefile.xml" or "My Documents\..." The file system is one
of the most radical differences between desktop and PDA apps. If you don't have it yet, The .NET Compact Framework Core Reference by MS Press is a Must Have, and Dan Fergus and Larry Roof have a book from APress coming out any
day now...it's over 1000 pages and you'll want to pick it up too.

HTH

Bill
"Sivaprasad" <ss********@hotmail.com> wrote in message
news:uF**************@TK2MSFTNGP09.phx.gbl...
Hello,

I am a beginner in Pocket PC development.
I am trying to load an xml into a treeview control of pocket pc.
Its throwing an exception "Directory not found"
But the same piece of code is working in .NET regular environment not

Pocket
pc.

For pocket PC is there any other library i should import to refer the xml object?.

Below is the code snippet i am using.
Can any one help me?
Any help is highly appreciated.

Thanks
Siva

'**************************Code Snippet **********************
Imports System.Xml


Private Sub cmdLoadXML_Click(ByVal sender As System.Object, ByVal e As
System.EventArgs) Handles cmdLoadXML.Click
Dim xmldocTest As New XmlDocument

Try

xmldocTest.Load("C:\My DotNet\abc.xml")
(The exception is triggered on this line)

DisplayXmlNode(xmldocTest, tvwLoadXML.Nodes)

' Expand the root node.
tvwLoadXML.Nodes(0).Expand()

Catch GetError As System.Exception
MessageBox.Show(GetError.Message)
End Try

End Sub

'**************************Code Snippet Ends**********************


Nov 20 '05 #6

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

3
by: Jimmy | last post by:
Dear All, I have a interesting question, may sound dump. Could I develop a vb6 programs that run under win2000 server terminal services and the program is access by a pocket pc? How could I...
1
by: santhosh_176 | last post by:
:I Created a Pocket PC application for iPAQ 5450. Every thing went fine even installer creation. I could run the setup and install it into the actual device and worked fine. The application enables...
2
by: dsnyder | last post by:
This HTML has a bit of Javascript at the end that puts the initial focus on the userID field. It works great on Windows2000 running IE6, but the initial focus never goes to the userID field on...
5
by: Oliver Huppert | last post by:
Hi all, can someone tell me what I need to develop applications for PPC2003 with C#? I have read several meanings about this topic. Do I need Visual Studio .NET or is Visual C# .NET Standard...
8
by: Krishnan Margabandhu | last post by:
I'm writing a Pocket PC app that will run when a device is first powered on. I want this program to get some data from the user and invoke a CAB file to install a software on the device. How do I...
10
by: Neil Wallace | last post by:
Guys, I am hopping mad. I am just a hobby programmer making little .net applications for pretty much no-one else but me to use. One application I have written would, to my mind, work best on...
2
by: Kent Briggs | last post by:
I'm a Delphi programmer with a need to create a Pocket PC app. Since full support for the .NET Compact Framework won't be added to Delphi for another year, I'm looking at learning VB. Apparently I...
3
by: Daniel Liberman | last post by:
Hi, everyone. That's my environment: - I have a pocket pc (iPAQ h4350) application developed with VSNET2003/C# that has a SQL Server CE Database, running. That's working fine. Obs: the pocket...
0
by: pumaken68 | last post by:
Does anyone has experience with calling web service from pocket pc 2003 project in VS 2005 environment? I just migrated a smart device(pocket pc 2003) solution from VS 2003 to VS 2005. There are...
5
by: Terry Metcalfe | last post by:
I have an Asus A696 pocket PC. I have written a small test program in VB6 called "Pocket PC" and compiled it just as I would normally do to run on my desk top. It runs on my desk top perfectly...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
1
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...
0
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and...
0
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
0
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated ...
0
muto222
php
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.