473,659 Members | 3,239 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 7591
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
2258
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 getConfig(self,value=None): config = ConfigParser.ConfigParser() config.readfp(open('config.inf')) return config.defaults()
3
3586
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 installing the VS.NET 2005 beta the web browser embedded control is now running in the .NET 2.0 beta runtime environment, and crashing. Is it possible to have different IE hosted controls running side by side in different versions of the .NET...
9
2997
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 trying to login with correct credentials it give me error: Server Error in '/PDVMgr' Application. ----------------------------------------------------------------------------
8
34623
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 web apps? Any help is greatly appreciated. Thanks,
5
1373
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
1705
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 denied exception. What could be causing this exception and what should i be looking at to fix the problem. Many Thanks Stuart
8
2064
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 monitor - each field (such as IP, hostname, etc.) is delimited by !!. Now, I want to be able to edit host information from within the GUI - what would be the best way to go about this? Basically I just need to either edit the original host line, or...
2
3862
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 extract OR - create a app.config file using xml is there another way?
0
8851
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, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
8747
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 tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
8528
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
1
6179
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
5649
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
4175
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
0
4335
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
2
1976
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
2
1737
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 can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

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.