473,387 Members | 1,575 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

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

App.config looping

I'd like to loop through the following custom app.config key:

----

<configSections>
<sectionGroup name="StemmerSettings">

<section name="catalog_1"
type="System.Configuration.NameValueSectionHandler ,system,
Version=1.0.3300.0, Culture=neutral, PublicKeyToken=b77a5c561934e089,
Custom=null" />
<section name="catalog_2"
type="System.Configuration.NameValueSectionHandler ,system,
Version=1.0.3300.0, Culture=neutral, PublicKeyToken=b77a5c561934e089,
Custom=null" />
<section name="catalog_3"
type="System.Configuration.NameValueSectionHandler ,system,
Version=1.0.3300.0, Culture=neutral, PublicKeyToken=b77a5c561934e089,
Custom=null" />

</sectionGroup>
</configSections>

<StemmerSettings>
<catalog_1>
<add key="dbconn" value="SERVER="connection string 1">
<add key="stemmer" value="Italian"/>
</catalog_1>
<catalog_2>
<add key="dbconn" value="SERVER="connection string 2">
<add key="stemmer" value="French"/>
</catalog_2>
<catalog_3>
<add key="dbconn" value="SERVER="connection string 3">
<add key="stemmer" value="French"/>
</catalog_3>
</StemmerSettings>

----

Essentially I'd like to return:

catalog_1
catalog_2
catalog_3

Is there anyway to accomplish this? I've tried:

public SortedList GetCatalogList()
{
SortedList _catalogList = new SortedList();
NameValueCollection nvc =
(NameValueCollection)ConfigurationSettings.GetConf ig("StemmerSettings");
foreach (string s in nvc.Keys)
{
_catalogList.Add( s, nvc[s] );
}
return _catalogList;
}
Nov 16 '05 #1
0 966

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

8
by: kaptain kernel | last post by:
i've got a while loop thats iterating through a text file and pumping the contents into a database. the file is quite large (over 150mb). the looping causes my CPU load to race up to 100 per...
2
by: ensnare | last post by:
Hi all, I'm using a database session handler and am looking to loop through data residing in the sessions table to make a 'Users online' array. I've found that using urldecode on the data...
45
by: Trevor Best | last post by:
I did a test once using a looping variable, first dimmed as Integer, then as Long. I found the Integer was quicker at looping. I knew this to be true back in the 16 bit days where the CPU's (80286)...
5
by: masood.iqbal | last post by:
My simplistic mind tells me that having local variables within looping constructs is a bad idea. The reason is that these variables are created during the beginning of an iteration and deleted at...
1
by: Diva | last post by:
Hi, I have a data grid in my application. It has 20 rows and I have set the page size as 5. I have a Submit button on my form and when I click on Submit, I need to loop through the rows in the...
2
by: Andy Sutorius via DotNetMonster.com | last post by:
I have 2 values in the web.config with a key of ServersInCluster. However when I execute this code I only get the 2nd value. I never get the 1st and 2nd value. Anyone know why? private void...
0
by: anthon | last post by:
Hi all - first post! anywho; I need to create a function for speeding up and down a looping clip. imagine a rotating object, triggered by an action, and slowly decreasing in speed, till it...
20
by: Ifoel | last post by:
Hi all, Sorry im beginer in vb. I want making programm looping character or number. Just say i have numbers from 100 to 10000. just sample: Private Sub Timer1_Timer() if check1.value= 1...
2
by: Davaa | last post by:
Dear all, I am a student making a MS Form application in C++. I would ask a question about "Timer". Sample code which I am developing is below. private: System::Void...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...

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.