473,396 Members | 1,707 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,396 software developers and data experts.

Complex app.config setting

Hi !

I understand that dotNet offers app.config to store application
configuration as below:

<configuration>
<appSetting>
<add key="MySettingKey1" value="MySettingValue1" />
<add key="MySettingKey2" value="MySettingValue2" />
</appSetting>
</configuration>

But this type of configuration is too flat. I want to have something
like this:

<configuration>
<appSetting>
<add key="MySettingKey1" value="MySettingValue1" />
<subElement1>A</subElement1>
<subElement2>B</subElement2>
</add>
</appSetting>
</configuration>

How could this read this using ConfigurationSetting class ?

Thanks

Bob
Nov 22 '05 #1
6 2153
Create as key value pairs and parse. Under 2.0 you have other options, but
today it is done like so:

<configuration>
<appSetting>
<add key="MySettingKey1" value="key=X;Sub1=Y;Sub2=Z" />
</appSetting>
</configuration>

--
Gregory A. Beamer
MVP; MCP: +I, SE, SD, DBA

***************************
Think Outside the Box!
***************************
"wuji" wrote:
Hi !

I understand that dotNet offers app.config to store application
configuration as below:

<configuration>
<appSetting>
<add key="MySettingKey1" value="MySettingValue1" />
<add key="MySettingKey2" value="MySettingValue2" />
</appSetting>
</configuration>

But this type of configuration is too flat. I want to have something
like this:

<configuration>
<appSetting>
<add key="MySettingKey1" value="MySettingValue1" />
<subElement1>A</subElement1>
<subElement2>B</subElement2>
</add>
</appSetting>
</configuration>

How could this read this using ConfigurationSetting class ?

Thanks

Bob

Nov 22 '05 #2
Create as key value pairs and parse. Under 2.0 you have other options, but
today it is done like so:

<configuration>
<appSetting>
<add key="MySettingKey1" value="key=X;Sub1=Y;Sub2=Z" />
</appSetting>
</configuration>

--
Gregory A. Beamer
MVP; MCP: +I, SE, SD, DBA

***************************
Think Outside the Box!
***************************
"wuji" wrote:
Hi !

I understand that dotNet offers app.config to store application
configuration as below:

<configuration>
<appSetting>
<add key="MySettingKey1" value="MySettingValue1" />
<add key="MySettingKey2" value="MySettingValue2" />
</appSetting>
</configuration>

But this type of configuration is too flat. I want to have something
like this:

<configuration>
<appSetting>
<add key="MySettingKey1" value="MySettingValue1" />
<subElement1>A</subElement1>
<subElement2>B</subElement2>
</add>
</appSetting>
</configuration>

How could this read this using ConfigurationSetting class ?

Thanks

Bob

Nov 22 '05 #3
As an alternative, what I have done is to create a class that models my
settings structure and then just serialize and deserialize the class to
an xml file.

Nov 22 '05 #4
As an alternative, what I have done is to create a class that models my
settings structure and then just serialize and deserialize the class to
an xml file.

Nov 22 '05 #5
"Chris Dunaway" <du******@gmail.com> wrote in news:1119045470.454569.12900
@o13g2000cwo.googlegroups.com:
As an alternative, what I have done is to create a class that models my
settings structure and then just serialize and deserialize the class to
an xml file.


You may find this even easier:
http://tinyurl.com/97nzb
--
Chad Z. Hower (a.k.a. Kudzu) - http://www.hower.org/Kudzu/
"Programming is an art form that fights back"

Make your ASP.NET applications run faster
http://www.atozed.com/IntraWeb/
Nov 22 '05 #6
"Chris Dunaway" <du******@gmail.com> wrote in news:1119045470.454569.12900
@o13g2000cwo.googlegroups.com:
As an alternative, what I have done is to create a class that models my
settings structure and then just serialize and deserialize the class to
an xml file.


You may find this even easier:
http://tinyurl.com/97nzb
--
Chad Z. Hower (a.k.a. Kudzu) - http://www.hower.org/Kudzu/
"Programming is an art form that fights back"

Make your ASP.NET applications run faster
http://www.atozed.com/IntraWeb/
Nov 22 '05 #7

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

Similar topics

2
by: Max Metral | last post by:
I'm trying to set the default behavior of customErrors in the machine.config. The documentation seems to suggest this should work, but it doesn't seem to work for me. On my development machine, I...
12
by: Ben | last post by:
I have a group of settings that I'd like to have inherited by multiple sites. I'm trying this, but it's not working. wwwroot\group\web.config wwwroot\group\site1\web.config...
5
by: Keith | last post by:
Hello all, I have a C# Windows Forms app. It is in namespace App.GUI. It builds to Nav.exe. I have entered an application level setting using the designer. Its type is string, name is "FOO"...
5
by: mmcd79 | last post by:
I built a VB.net application that makes use of a machine level DB connection string setting, and a user level starting location setting. The machine level setting and the default user based...
9
by: antonyliu2002 | last post by:
By default, IIS is configured to timeout a session in 20 minutes, which can be changed through the IIS config window. I use InProc sessionState mode. I can also set the session timeout in...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
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
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
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...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...

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.