i have one ASP application and i want to use that for 2(or more) place and each of them has their Database , now is there a way to change connection string when user log in? or anyway to change database for each user?
i saw this question before
How to setup single-code multiple-database ASP.NET SaaS application
but i couldn't figure out how it works!
please help me
EDITED:
I found a way for this problem I saved my connection strings on database for each user, after identification i will figure out which connection string is for this user, and then assign that to my data sources an etc ...
saved connection string
"Integrated Security=SSPI;Persist Security Info=False;Initial Catalog=DB;Data Source=."
ASP
<asp:SqlDataSource ID="DataSource" runat="server" ProviderName="System.Data.SqlClient </asp:SqlDataSource>
C#
DataSource.ConnectionString = "Integrated Security=SSPI;Persist Security Info=False;Initial Catalog=DB;Data Source=.";
For Linq to SQL
DataClasses1DataContext m = new DataClasses1DataContext("Integrated Security=SSPI;Persist Security Info=False;Initial Catalog=DB;Data Source=.");
i hope useful for other which has this issue