locked
Web Servuce To Connect to Multiple Database ? RRS feed

  • Question

  • User2105156359 posted

    Hi,

    I have a situation,I have a web service which do some process, but there are multiple Databases which are going to be hosted,also may get wider so i dont know the excat number and they are not in one place. Is there anyway i can connect to these Database without adding all the connections string in web.config. I mean when the user calls the web service from a place , use one DB. When another user from different place call the web service use another DB and so on. Like some login or passing the connection string over the web service call mechanism. Or something else, any ideas are welcome.

    Friday, February 8, 2013 7:14 AM

All replies

  • User-1862002211 posted

    Here are some Ideas of mine:

     

    1. use one database for storing user information and also the database and server details. And Then, you can retrive the databse and server details whenever the user logins and initinate the connection based on the retrived detials.

     

    2. IF all the databases using a same server, You may use "SqlConnection.ChangeDatabase" to change database.

     

     

    Friday, February 8, 2013 8:13 AM