Aniket Yadav

Aniket Yadav

  • NA
  • 41
  • 0

Switch Database Connection

Dec 7 2010 1:57 AM
I have One Weird Query.

Is it possible to switch from one database to other database programmatically?

For Eg:

I have one Master Database

Master Database:
CompanyID Password ConnStr
ABC0001 ****** MyConnStr1
ABC0002 ****** MyConnStr2

Now the user will login using his company credentials.
For Valid Login, The connection for the database will be changed taking the connection string from the master database.

And the user will be able to access the data from the other database.

So is it possible to implement such logic...

If Yes then please provide me the idea...

Please Help Me