i make that and didnt work, i dont have activesync installed... i must
install it? but if i put content, souldnt copy automatically???
for reading the config, i dont make a config, i make an xml standard...
code:
XmlDocument doc = new XmlDocument();
doc.Load("Server.Config");
XmlNodeList el = doc.GetElementsByTagName("SqlConnection");
IEnumerator enu = el.GetEnumerator();
XmlElement conn = (XmlElement)el.Item(0);
return conn.GetAttribute("value");
XML:
<?xml version="1.0" encoding="utf-8" ?>
<config>
<appSettings>
<SqlConnection value="Integrated Security=SSPI;Persist Security
Info=False;Initial Catalog=Northwind;Data Source=ROTHARIGER;Packet Size=4096"
/>
</appSettings>
</config>
i know there is a way for reading the .config file, but i dont know it... i
must to look up... if i find a way, i let you know..!!!
thanks anyway..!!!
[quoted text, click to view] "Lonifasiko" wrote:
> Include it in the project and action generated (as you said) must me
> "Content". This way de XML file is deployed physically to the device
> via ActiveSync with the resultant .exe.
> Under "Programs File" of your device (is the default directory), you
> should have a .exe and the XML file.
>
> Permit me asking you a related question: How do you read the XML
> configuration file? I've tried reading .exe.config configuration files,
> using OpenNETCF.Configuration namespace. Works pretty well but I yet
> haven't tried reading raw XML files. Could anybody let us know which
> approach is the best for reading configuration files?
>
> And Rothariger, could you post a example of your XML file and how you
> read it please?
>
> Thanks very much.
>
As I've told you in my previous post, I use OpenNetCF's Configuration
namespace to read .config files and it's really simple, and I suppose
with a better performance than reading a .xml file. Look up in
OpenNETCF's forums
Anyway, take a look at this post in order you can make a idea of how to
read a .config file:
http://www.opennetcf.org/forums/topic.asp?TOPIC_ID=5383 Besides, I would advise you to surf this forum, there are many
interesting things.
The first part of your post: Are you debugging with the VS.NET
emulator? The XML file generated as "content" deployment, I think
should work.
I always test in a real device and I can guarantee you that the XML
file as content is deployed to the device with the application output.
Hope that helps.