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

Complex app settings in 2.0

Hey everyone, hopefully this will have a simple answer. Using VS2005/.NET
2.0 Application settings.

I have simple settings working fine, but I am trying to store more complex
types now.

For example a collection of city/state/country's

e.g.

los angeles, california, usa
boston, massachusets, usa
......

I would like store it in a xml format rather than CSV

i.e. in collection, get cities.city, cities.state, cities.country or similar

Is this easy or possible to do with the scope of 2.0 App settings? Which
type should be used (I tried xmldocument but it didn't like it)? Can data be
grabbed from an external xml file?

Or is this not a good idea in general for complex settings, and should the
be kept in a seperate xml file that's different that app settings?

Thanks, Ivan
Jul 16 '06 #1
3 1514
Hi Ivan,

This can be done by creating your own custom Configuration Sections and
corresponding Configuration classes. See:

http://www.developer.com/net/net/article.php/3617366
http://www.devx.com/dotnet/Article/27562/0/page/1
http://www.codeproject.com/dotnet/cu...ctionsNet2.asp

--
HTH,

Kevin Spencer
Microsoft MVP
Professional Chicken Salad Alchemist

What You Seek Is What You Get.
"Ivan Berg" <iv******@avaya.comwrote in message
news:e2*************@TK2MSFTNGP05.phx.gbl...
Hey everyone, hopefully this will have a simple answer. Using VS2005/.NET
2.0 Application settings.

I have simple settings working fine, but I am trying to store more complex
types now.

For example a collection of city/state/country's

e.g.

los angeles, california, usa
boston, massachusets, usa
.....

I would like store it in a xml format rather than CSV

i.e. in collection, get cities.city, cities.state, cities.country or
similar

Is this easy or possible to do with the scope of 2.0 App settings? Which
type should be used (I tried xmldocument but it didn't like it)? Can data
be grabbed from an external xml file?

Or is this not a good idea in general for complex settings, and should the
be kept in a seperate xml file that's different that app settings?

Thanks, Ivan

Jul 16 '06 #2
"Ivan Berg" <iv******@avaya.comwrote
[Complex Configuration Data]
I would like store it in a xml format rather than CSV
Beyond a certain point, the key/value pair structre of an application config
file just doesn't cut it any more.

Fortunatly writing a custom configuration section is breeze, and will do
exactly what you want. Check out:
http://msdn2.microsoft.com/en-us/library/2tw134k3.aspx

Everything there applies to all config files, not just Asp.Net configuration
files.

--
Chris Mullins
http://www.coversant.net/blogs/cmullins

Jul 16 '06 #3
Appreciate the replys Kevin and Chris. I will take a look at the links.

Ivan

"Ivan Berg" <iv******@avaya.comwrote in message
news:e2*************@TK2MSFTNGP05.phx.gbl...
Hey everyone, hopefully this will have a simple answer. Using VS2005/.NET
2.0 Application settings.

I have simple settings working fine, but I am trying to store more complex
types now.

For example a collection of city/state/country's

e.g.

los angeles, california, usa
boston, massachusets, usa
.....

I would like store it in a xml format rather than CSV

i.e. in collection, get cities.city, cities.state, cities.country or
similar

Is this easy or possible to do with the scope of 2.0 App settings? Which
type should be used (I tried xmldocument but it didn't like it)? Can data
be grabbed from an external xml file?

Or is this not a good idea in general for complex settings, and should the
be kept in a seperate xml file that's different that app settings?

Thanks, Ivan

Jul 17 '06 #4

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

Similar topics

3
by: Peter Olsen | last post by:
I want to define a class "point" as a subclass of complex. When I create an instance sample = point(<arglist>) I want "sample" to "be" a complex number, but with its real and imaginary...
34
by: Pmb | last post by:
I've been working on creating a Complex class for my own learning purpose (learn through doing etc.). I'm once again puzzled about something. I can't figure out how to overload the assignment...
17
by: Chris Travers | last post by:
Hi all; I just made an interesting discovery. Not sure if it is a good thing or not, and using it certainly breakes first normal form.... Not even sure if it really works. However, as I am...
0
by: Shawn Cutter | last post by:
I am beginning work on a somewhat complex project and I need to decide what route to take before beginning the project. The main issue with this project is that it needs to be modular and support...
2
by: Dave Booker | last post by:
How are complex data types saved and restored when used as User-scoped Application Settings? For an example of what I'm trying to do that does not work, take the following: A project has a...
2
by: Arvid Requate | last post by:
Hello, I'd like to understand why the following code does not compile. It looks like a strangeness in connection with overload resolution for the <complex> header: The conversion operator...
0
by: SR | last post by:
I have a semi-complex object similar to what follows: -Window - Screens - PropertyOne - PropertyTwo - PropertyThree -Fields - PropertyOne - PropertyTwo
55
by: rhino | last post by:
I need to learn more about making two kinds of menus: A. menus that have hierarchies of three or four levels B. horizontal menus that have so many options that they are wider than the available...
3
by: Eric Davidson | last post by:
DB2 9.5 I keep geting the message. SQL0101N The statement is too long or too complex. SQLSTATE=54001 When one of my sql statements takes over 60 seconds to compile the sql statement. Is...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
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: 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
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: 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
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
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.