Asp.net on the fly connection string changes
Posted on 2007-04-03
I am building a VS2005 ASP.net C# application that requires database access
with on the fly connection string changes based on user logged in.
All that needs to change is the database name / server name
using a trusted connection and no user password is stored in the string.
This is what I was thinking of doing.. or do you have a better
Create a class that uses the connection string builder class
look up the user name and the associated db server/dbname stored
in a database table and return the connection string.
On each page that requires access to the db use the class to set the connection string .