C
craigkenisston
How to change database name on the fly?
I have an asp.net application in which a user connects to a sql server,
where there's a centralized database with the users table and general
settings.
Then, each user also has a database in which his particular information
is stored. There will be a few hundreds of this databases. Certain
groups of users will share a database, all tables in this database have
a userid column for identification which rows are whose. (BTW, this
strange setup is to circunvent the 4GB limit on SQL Server Express,
don't see me, ask my boss).
Now, how do I implement this in asp.net? The web.config contains a
hardcoded connection string, which right now points to the centralized
database and works up to the login point.
After that I don't know what to do next.
I'm using a BLL and DAL layers which points directly to this database
connection string.
I mean, even if I store a second connection string, how am I supposed
to change the databasename ? simple search&replace ?
Are there known techniques, approaches or pattern to do this ?
I have an asp.net application in which a user connects to a sql server,
where there's a centralized database with the users table and general
settings.
Then, each user also has a database in which his particular information
is stored. There will be a few hundreds of this databases. Certain
groups of users will share a database, all tables in this database have
a userid column for identification which rows are whose. (BTW, this
strange setup is to circunvent the 4GB limit on SQL Server Express,
don't see me, ask my boss).
Now, how do I implement this in asp.net? The web.config contains a
hardcoded connection string, which right now points to the centralized
database and works up to the login point.
After that I don't know what to do next.
I'm using a BLL and DAL layers which points directly to this database
connection string.
I mean, even if I store a second connection string, how am I supposed
to change the databasename ? simple search&replace ?
Are there known techniques, approaches or pattern to do this ?