473,503 Members | 1,635 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Runtime editing in web.config

13 New Member
My web application is using multiple databases according to user requirement.

Means user can choose the database from available database ( Available databases are maintained in web.config file in form of a key - values)

Now when I have to change the available connection or have to add a new one then I have to go to web.config and edit that one.



Now the new requirement is to update web.config from an admin module which resides in different independent application.

My Question is ...

(1) Can I change ( Access) my present web.config file from this independent application and if yes then how do i change it.

(2) If I can't then what should I do.

Making admin module in the present application is my last option.
Jul 9 '07 #1
5 7582
dip_developer
648 Recognized Expert Contributor
My web application is using multiple databases according to user requirement.

Means user can choose the database from available database ( Available databases are maintained in web.config file in form of a key - values)

Now when I have to change the available connection or have to add a new one then I have to go to web.config and edit that one.



Now the new requirement is to update web.config from an admin module which resides in different independent application.

My Question is ...

(1) Can I change ( Access) my present web.config file from this independent application and if yes then how do i change it.

(2) If I can't then what should I do.

Making admin module in the present application is my last option.
Read this article.Hope it will help you.
Edit web.config in runtime.

but keep in mind.....

it's not a good idea to edit web.config at runtime.Realize that any change you make to web.config will result in the application being restarted on your webserver. This means all the sessions go bye-bye. The best way to store dynamic data like this, doesn't have to be in web.config, rather is in a database, or a xml config file you can parse at runtime, without interrupting the flow of things.
Jul 9 '07 #2
Spanco
13 New Member
Thanks 4 reply....

What i Know that in ASP.NET 2.0 IIS Does not restart the application,I may be wrong please reply me.




Read this article.Hope it will help you.
Edit web.config in runtime.

but keep in mind.....

it's not a good idea to edit web.config at runtime.Realize that any change you make to web.config will result in the application being restarted on your webserver. This means all the sessions go bye-bye. The best way to store dynamic data like this, doesn't have to be in web.config, rather is in a database, or a xml config file you can parse at runtime, without interrupting the flow of things.
Jul 9 '07 #3
dip_developer
648 Recognized Expert Contributor
Thanks 4 reply....

What i Know that in ASP.NET 2.0 IIS Does not restart the application,I may be wrong please reply me.
see this

http://www.extremeexperts.com/Net/Ar...PNETPart2.aspx

it's also a good site to consult

http://aspalliance.com/820
Jul 9 '07 #4
Spanco
13 New Member
Thanks Really good Stuff.

But what iam trying to do is : There is a Seperate application to edit the web.config of a currently running site.

Iam trying it throught web service if it is done sucessfull i will get back to you.

bi

see this

http://www.extremeexperts.com/Net/Ar...PNETPart2.aspx

it's also a good site to consult

http://aspalliance.com/820
Jul 9 '07 #5
Sandeepcs3
1 New Member
Here is a link that provide good explanation of editing web.config at runtime

http://www.a2zmenu.com/CSharp/Modify...20runtime.aspx
Jun 29 '10 #6

Sign in to post your reply or Sign up for a free account.

Similar topics

1
2248
by: Mike Zupan | last post by:
I need to edit the value(s) of a config file via a GUI interface. I'm trying to use ConfigParser but set() doesn't seem to write. Here are my reading and writing functions def...
3
3575
by: Mathew | last post by:
Hi How do you specfiy the version of the .net runtime libraries loaded for a ..net controls hosted in Internet Explorer 6? I have a control that's designed to work with .NET 1.1, but after...
9
2970
by: Marina Anufreichik | last post by:
Hi, After deploymnet web application on web server I can access page on local machine and login fine but when I'm trying to access web site from remote machine I can see login page, but when I'm...
8
34546
by: Subra Mallampalli | last post by:
Hi, I am trying to use <runtime> section within the web.config file. However, the contents of the <runtime> section seem to be ignored. What am i missing here? Is <runtime> section not used by...
5
1363
by: inetmug | last post by:
I would like my ASP.NET apps to pick up there associated assembly references at runtime but I do not see a runtime tag in the web.config schema, or am I wrong? -- Patrick
5
278
by: Kiyomi | last post by:
Hello, I have created two different ASP.NET applications and placed one in the root and another one in a sub-directory. http://localhost/MyApp_1/Index.aspx
4
1698
by: Stuart Ferguson | last post by:
I am attempting to put a screen in a web application that allows editing of AppSettings values in the Web.Config file using the Web Configuration manager class however on he .Save i get an access...
8
2050
by: D | last post by:
Hi, I currently have a Python app with a Tkinter GUI frontend that I use for system administration. Everytime it launches, it reads a text file which contains info about each host I wish to...
2
3849
by: Christian Muggli | last post by:
can someone explain me how to create a app.config file during runtime? i see two ways: - add a skeleton of an app.config file to the exe/dll and extract it during runtime as a resource and...
0
7202
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
7086
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
7280
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
7332
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
5578
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
0
3154
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
0
1512
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated ...
1
736
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
0
382
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence...

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.