I am working on a MVC 4 web site. It should allow the user to select which database to be connected with depending on user selection from the View. All the databases have the same table structure and schema etc.
I have a database ConnectionString defined in the Web.config file that allows for connection to the first database.
<add name="DBConnectionString" connectionString="Data Source=DATABSE_SERVER;Initial Catalog=DATABASE_NAME;Persist Security Info=True;User ID=USERNAME;Password=PASSWORD" providerName="System.Data.SqlClient" />
I also used Linq DataContext to initialize connection to the database. Table mappings were all automatically generated by Linq to SQL in MVC 4.
public NEMP_DataDataContext() :
What is the best way to achieve this?