By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
455,266 Members | 1,300 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 455,266 IT Pros & Developers. It's quick & easy.

AppSettingsReader GetValues

P: n/a
Hi,
Consider following app.config

<configuration>
<appSettings>
<add key="Fields" value="Field1" />
<add key="Fields" value="Field2" />
<add key="Fields" value="Field3" />
</appSettings>
</configuration>

Is there any way to retrieve all three values for one key.
Its very possible and easy in an XML Document ( infact i do it but as an
app.config.xml ).
So the AppSettingsReader provide ONLY ONE method GetValue and the internal
XML Document isnt exposed.

ReQuote: How to get multiple values on same key from an app.config file ?
Something Like GetValues( key, values() )

So is there a way to do it without writing own XML document parsing code?

Thanx in advance
rawCoder
Nov 21 '05 #1
Share this Question
Share on Google+
2 Replies


P: n/a
Take a look at this article:

http://www.gotdotnet.com/Community/U...5-0a217c8eb94c

Crouchie1998
BA (HONS) MCP MCSE
Nov 21 '05 #2

P: n/a
Hey,

Take a look at using the ConfigurationSettings.GetConfig() method. I found
the the help file to be of almost negative assistance. Here's a link that's
helped me along:

http://dotnet247.com/247reference/a....ionHandler.asp

Basically, you can define configuration sections that can be mapped to a
class you define in code, which can contain pretty much any representation
of the data you want.

HTH,

John

"rawCoder" <ra******@hotmail.com> wrote in message
news:uv*************@tk2msftngp13.phx.gbl...
Hi,
Consider following app.config

<configuration>
<appSettings>
<add key="Fields" value="Field1" />
<add key="Fields" value="Field2" />
<add key="Fields" value="Field3" />
</appSettings>
</configuration>

Is there any way to retrieve all three values for one key.
Its very possible and easy in an XML Document ( infact i do it but as an
app.config.xml ).
So the AppSettingsReader provide ONLY ONE method GetValue and the internal
XML Document isnt exposed.

ReQuote: How to get multiple values on same key from an app.config file ?
Something Like GetValues( key, values() )

So is there a way to do it without writing own XML document parsing code?

Thanx in advance
rawCoder

Nov 21 '05 #3

This discussion thread is closed

Replies have been disabled for this discussion.