Hey all,
I have an application that does projection of data for my client over a length of time. In order to allow the client to 'play' w/ other scenarios w/o messing up production data, they are able to choose alternative databases (basically What-If scenarios) at any point, which are a copy of the production database as of a given time. Currently, I have bit of code in place that basically does a string replacement on the connection string, which will hot-swap the server name and database name, based on the user's selection stored in the session state.
This approach works well for what I am doing, although it does require me to pass around those selections throughout every layer. Here is my question: I would like to be able to create a custom connection string that would handle this 'switching' in the background and allow me to use a connection string just like I do in a standard Asp.Net application.
In other words, many asp.net tools accept just a connection string name as part of their constructor. I would like to be able to utilize those tools, but cannot do so b/c of the way I currently build my connection string. Is there a way to support this behavior on a user session level?