Membership Role Provider for Multiple databases
-
I am developing an application for which I have to provide a hosted version for the client.Well the problem that is bugging me is as follows: Different users from different companies will be connecting to the ASP.net application. I want to keep each company's data and login information in a separate database and one ASP.net application in the front. Now the problem is how to make this possible? In SQL Server Role and Membership provider, database connection string is in web.config. If I have to write a custome provider, then what should be the approch by keeping one ASP.net application in the front for multiple databases. I would appreciate ideas and comments on the problem Thanks, Fahad
-
I am developing an application for which I have to provide a hosted version for the client.Well the problem that is bugging me is as follows: Different users from different companies will be connecting to the ASP.net application. I want to keep each company's data and login information in a separate database and one ASP.net application in the front. Now the problem is how to make this possible? In SQL Server Role and Membership provider, database connection string is in web.config. If I have to write a custome provider, then what should be the approch by keeping one ASP.net application in the front for multiple databases. I would appreciate ideas and comments on the problem Thanks, Fahad
When a user logs in you could produce the connection string "" + companyName + "" and store it in a Session variable, then everytime you use the connection string you do Session["ConnectionString"] rather than ConfigurationSettings.AppSettings["ConnectionString"]. If each company has their own login frontend then this should be easy.
-
When a user logs in you could produce the connection string "" + companyName + "" and store it in a Session variable, then everytime you use the connection string you do Session["ConnectionString"] rather than ConfigurationSettings.AppSettings["ConnectionString"]. If each company has their own login frontend then this should be easy.
The problem is the Membership provider has no interface to change the underlying connection string, it is in the web.config file. Should i try to add connection string property to the SQLMembership provider and try to use that. How that sounds?