|
Thread: xml
-
Feb 20th, 2004, 05:11 AM
#1
Thread Starter
Fanatic Member
xml
Hi,
This is the c# code which retrieves the two names from the app.config file.
private void GetSettings()
{
System.Collections.Specialized.NameValueCollection colNameVal = null;
colNameVal = System.Configuration.ConfigurationSettings.AppSettings;
strServer = colNameVal["ServerName"];
strDatabase = colNameVal["DatabaseName"];
}
the xml in app.config:
<?xml version="1.0" encoding="utf-8" ?>
<configuration>
<appSettings>
<add key="ServerName" value="svr07" />
<add key="DatabaseName" value="TradarBe" />
</appSettings>
</configuration>
Do you know why the strServer and the strDatabase variables in the c# code are not returning the correct names?
Thanks
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|