Is there a way to be able to create a new database when a company signs up to my site, and be able to use that database when he/she logs in, so for example if company A logs in he uses CompanyA database and if company B logs in he uses Company B database, now they all have the same table structure, just need to figure out a way use a specific database depending on the user that logs in.

8 Years
Discussion Span
Last Post by dnanetwork

Try this resource and see if it helps you.

As for finding a way to use a specific database depending on the user that logs in, simply make your connection string dynamic and populate the DB name at the time of user login. DB name can be stored in the login table along with their username/password/etc and retrieved at the time of login to insert into your dynamic DB connection string for these purposes.

Hope this helps :) Please remember to mark as solved once your issue is resolved. Also, don't be afraid of Google, it doesn't bite :twisted:

This topic has been dead for over six months. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.