I have a classic ASP application which has connection string stored as an application variable and are initialized in Application_OnStart()
event.
I want to change this connection string every midnight and have it point to other database.
I thought of something like having an XML for connection string, use C# EXE with task scheduler to change this and then restart the IIS and finally read the modified connection string from the XML in Application_OnStart()
, but I do not want users to loose their sessions. And also there are huge number of places where this connection string is being used, so I can not think of adding logic to read the XML at each of those places (with a C# COM component).
Are there any ways to achieve this ? Is there any storage/event etc, to use where I can store this connection string and update it without having to restart the application ?
Any help would be really appreciated.