-----------------------------------------------------------
New Message on BDOTNET
-----------------------------------------------------------
From: rags_rao
Message 2 in Discussion
appsetting is already a section (of type NameValueCollection) u cant have a section
under it. u can have your own section thou. here's how u do it......... 1. define ur
section under configSections tag in web.config (or machine.config in ur case) ex:
<configSections>
<sectionGroup name="ragsSections">
<section name="ragsSection" type="System.Configuration.NameValueSectionHandler,System,
Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" />
</sectionGroup>
</configSections> 2. now u can add ur section that conforms to the definition ex:
<ragsSections>
<ragsSection>
<add key="key1" value="value1"/>
<add key="key2" value="value2"/>
</ragsSection>
</ragsSections>
how to access it in ur code? like this:
System.Collections.Specialized.NameValueCollection coll =
(System.Collections.Specialized.NameValueCollection)System.Configuration.ConfigurationSettings.GetConfig("ragsSections/ragsSection");
//notice that ragsSection is of type System.Configuration.NameValueSectionHandler
string value = coll["key1"];
--
"No more money, no more fancy dress. This other kingdom seems by far the best until
its other jaw reveals incest"
- Jim Morrison
-----------------------------------------------------------
To stop getting this e-mail, or change how often it arrives, go to your E-mail
Settings.
http://groups.msn.com/bdotnet/_emailsettings.msnw
Need help? If you've forgotten your password, please go to Passport Member Services.
http://groups.msn.com/_passportredir.msnw?ppmprop=help
For other questions or feedback, go to our Contact Us page.
http://groups.msn.com/contact
If you do not want to receive future e-mail from this MSN group, or if you received
this message by mistake, please click the "Remove" link below. On the pre-addressed
e-mail message that opens, simply click "Send". Your e-mail address will be deleted
from this group's mailing list.
mailto:[EMAIL PROTECTED]