Click here to Skip to main content
15,890,123 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
I need to deploy my asp.net web application on Cloud. Accordingly, I need to set up my application. Following this, the structure of application is as follows : I will have SQL Server Management Studio 2013 installed on cloud server for storing and maintaining client's database. The asp.net web application will be hosted in cloud. All client will access same web application but their database will be different.

The requirement is different client from different organisations should login in same application hosted on cloud via cloud URL given to them. Based on the login given to them by software company, the application must identify the datasource and database from numerous database stored.

So, the challange here is based on the login and password of client, I need to code the application to connect to datasource and database to connect that client. I am using linq-to-sql framework.

I am thinking of adding datacontext and updating web.config file on server but this seems to be bad approach. How can I code to link to particular datacontext based on login without updating the code???

Can you please provide your suggestions.??
Thanks in advance.
Posted
Comments
Sreekanth Mothukuru 13-Sep-15 15:02pm    
I think you can use data context with a constructor which accepts connection string as a parameter. The connection string or data source will change dynamically based on the user login. In any case all the databases should be similar. I mean the schema should be same.

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900