473,387 Members | 1,903 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.

Creating and Consuming XML configuration

Is there an example anywhere of how to create and consume XML configuration
information via code?

I've got a site for which I want to present the user with a web form for
configuration information and allow them to fill in the form and persist it
to an XML file on the web server. This XML file can then be read at run-time
for another page to use in constructing itself. The form code and
customization code I have done - but I'm wondering if there's a "best
practices" example on how to create and consume and XML config file.

I've come to the conclusion that using the DOM to write to the web.config is
a bad idea, since, as has been pointed out to me, it will cause a re-start
every time it's written.

Thanks in advance!

Christopher
Nov 17 '05 #1
2 1140
If you didn't need to write the data back out, this is how you use the
web.config file to store crap:

http://www.c-sharpcorner.com/Code/20.../ConfigApp.asp

I'm a big fan of keeping things like you describe in a database. In today's
day and age, with fast networks, fast processors - a local database (SQL2K,
NOT Access) can really be considered part of the immediate app.. because
access time is so negligible...
"Christopher Ambler" <ch***@ambler.net> wrote in message
news:eC**************@tk2msftngp13.phx.gbl...
Is there an example anywhere of how to create and consume XML configuration information via code?

I've got a site for which I want to present the user with a web form for
configuration information and allow them to fill in the form and persist it to an XML file on the web server. This XML file can then be read at run-time for another page to use in constructing itself. The form code and
customization code I have done - but I'm wondering if there's a "best
practices" example on how to create and consume and XML config file.

I've come to the conclusion that using the DOM to write to the web.config is a bad idea, since, as has been pointed out to me, it will cause a re-start
every time it's written.

Thanks in advance!

Christopher

Nov 17 '05 #2
Thanks for replying, but let me state it again.

I do want to write it back out, as I said below:
I've got a site for which I want to present the user with a web form for
configuration information and allow them to fill in the form and persist
it to an XML file on the web server.
And while I realize that a database is always a good option, I not only
don't have rights to install one on this server, but don't have the spare
cash to purchase SQL server for such a small site.

I'm looking for an example of what I *want* to do, not what I *should* be
doing :-)

Christopher

"Frank Drebin" <no*****@imsickofspam.com> wrote in message
news:g5**********************@newssvr28.news.prodi gy.com... If you didn't need to write the data back out, this is how you use the
web.config file to store crap:

http://www.c-sharpcorner.com/Code/20.../ConfigApp.asp

I'm a big fan of keeping things like you describe in a database. In today's day and age, with fast networks, fast processors - a local database (SQL2K, NOT Access) can really be considered part of the immediate app.. because
access time is so negligible...
"Christopher Ambler" <ch***@ambler.net> wrote in message
news:eC**************@tk2msftngp13.phx.gbl...
Is there an example anywhere of how to create and consume XML configuration
information via code?

I've got a site for which I want to present the user with a web form for
configuration information and allow them to fill in the form and persist

it
to an XML file on the web server. This XML file can then be read at

run-time
for another page to use in constructing itself. The form code and
customization code I have done - but I'm wondering if there's a "best
practices" example on how to create and consume and XML config file.

I've come to the conclusion that using the DOM to write to the web.config is
a bad idea, since, as has been pointed out to me, it will cause a

re-start every time it's written.

Thanks in advance!

Christopher


Nov 17 '05 #3

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

Similar topics

2
by: David Elliott | last post by:
I am creating a configuration class to read / write a standard configuration file. <?xml version="1.0" encoding="utf-8"?> <configuration> <appSettings> <add key="ConnectionString"...
6
by: Ferrari, Eduardo | last post by:
Hi all! I'm trying to create this XML file: <?xml version="1.0" encoding="utf-8" ?> <Build type="Daily" sync="True" compile="True" assemble="True" > <Sync version="1.0.0.0" branch="QA">...
0
by: Claire | last post by:
1) I create an alternative configuration "deploy" in configuration manager. This is derived from the "release" configuration. I do nothing to this configuration except ask it to build and Im...
1
by: eje | last post by:
I want to use configSections for applicationsettings but I get Exception creating section handler. My code in web.config: <configuration> <configSections> <sectionGroup...
2
by: saran | last post by:
I am having a problem with MySQL consuming a lot of memory and eventually throwing an Out of Memory error and restarting itself. The symptoms are that swap usage continues to rise until some...
0
by: thehitman | last post by:
I used an article "Creating a Flexible Configuration Section Handler "(http://www.15seconds.com/issue/040504.htm). The Console application works with app.config but with the web.config. The...
3
by: Lambuz | last post by:
Hi all, I've got this problem. I've to implemente a solution like the example in http://support.microsoft.com/default.aspx?scid=kb;EN-US;313891, but I can't configure correctly the example. ...
1
by: Andreas Cieslik | last post by:
Hello, What is the best and professional way to deploy a DLL that consumes the customers webservice url instead of my coded webservice url of my local test system? Is there a way to keep it...
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: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
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?
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
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.