App Config

G

Guest

Hi,

I would like to add a different section to the app.config file like the
following
<configuration>
<connections>
<add key="con1" value="blahblahblah" />
</connections>

In the ConfigurationSettings.AppSettings.Get(), what would the string be in
order to get to con1?

Thanks,
JJ
 
I

Ignacio Machin \( .NET/ C# MVP \)

Hi,

You can use ConfigurationSettings.GetSection

A warning though.
I tried to use it once, and at the end I found easier to just use the
AppSettings , you see the framework does provide readily access to
AppSettings, I don't remember details now but I found more difficult to work
with a custom section.


cheers,
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top