Are you really sure the tag isn't appSettings ?... For appParams isn't part
of standard .net config files:
If you want to use appParams, you've got to declare it inthe xml and then
the way you access it isn't as simple as for appSettings:
1 - sample App.exe.config:
<?xml version="1.0" encoding="utf-8"?>
<configuratio n>
<configSections >
<section name="appParams "
type="System.Co nfiguration.Nam eValueSectionHa ndler,system,
Version=1.0.330 0.0, Culture=neutral , PublicKeyToken= b77a5c561934e08 9,
Custom=null"/>
</configSections>
<appSettings>
<add key="key1" value="value1" />
</appSettings>
<appParams>
<add key="key2" value="value2" />
</appParams>
</configuration>
You'll notice that because appParams isn't standard, you have to declare it
in the configSections part.
2 - Accessing values (in C#) :
using System.Configur ation;
using System.Collecti ons.Specialized ;
// It's easy to retreive value1:
string s1 = ConfigurationSe ttings.AppSetti ngs["key1"]; // s1 contains
"value1".
// A little more tricky for value2:
NameValueCollec tion nvc = ConfigurationSe ttings.GetConfi g("appParams" ) as
NameValueCollec tion;
string s2 = nvc["key2"]; // s2 contains "value2".
Olivier DALET
---------------
"John Galt" <nf*@nospam.com > a écrit dans le message de
news:O1******** ******@TK2MSFTN GP10.phx.gbl...
The problem is that this is being used by Microsoft's Data Application
Block. I need the connection screen info to display which system the
application is pointing to (Development, Production, etc.)
"Morris" <an*******@disc ussions.microso ft.com> wrote in message
news:CD******** *************** ***********@mic rosoft.com... Try: appSettings instead of <appParams><?xm l version="1.0"
encoding="utf-8" ?><configuratio n><appSettings> <add key="Connection String"
value="YourStri ng"/></appSettings></configuration>
The rest looks good.
Good luck.