Hello Jay,
It sounds like it cannot find the file. This is most likely being caused by
one of two things.
1) The file is not on the Device. Make sure that the file exists on the
devices and the file name is spelled correctly.
2) The path to the file is not correct. Here is some code that will help
you get the path to where the executable is located.
String fullAppName = Assembly.GetExecutingAssembly().GetName().CodeBase;
String fullAppPath = Path.GetDirectoryName(fullAppName);
String fullFileName = Path.Combine(fullAppPath, "test.xml");
System.IO.FileStream fs = new System.IO.FileStream(fullFileName,
System.IO.FileMode.Open);
System.IO.StreamReader sr = new System.IO.StreamReader(fs);
string xml = sr.ReadToEnd();
Note: I just read this into a string so that you can see if it is working.
Once you have an appropriate fullFileName you can use whatever stream
reading functionality that fits your needs.
Here is a link to the .NET Compact Framework FAQ that discusses this
http://msdn.microsoft.com/mobility/prodtechinfo/devtools/netcf/faq/default.aspx#7.1
I this does not solve the problem for you, please reply this post with more
details.
Take care,
Tom Krueger
Microsoft Corporation
Program Manager
http://weblogs.asp.net/tom_krueger
This posting is provided "AS IS" with no warranties, and confers no rights.
Use of included script samples are subject to the terms specified at
http://www.microsoft.com/info/cpyright.htm