471,348 Members | 1,877 Online
Bytes | Software Development & Data Engineering Community
Post +

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 471,348 software developers and data experts.

AppSettingsReader GetValues

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
Jul 21 '05 #1
2 2353
Take a look at this article:

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

Crouchie1998
BA (HONS) MCP MCSE
Jul 21 '05 #2
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

Jul 21 '05 #3

This discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

reply views Thread by Marty McDonald | last post: by
3 posts views Thread by Lloyd Dupont | last post: by
6 posts views Thread by Gabriël | last post: by
2 posts views Thread by Armin Bajramovic | last post: by
2 posts views Thread by rawCoder | last post: by
reply views Thread by Tina | last post: by
1 post views Thread by Jeff Mason | last post: by

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.