Last post Jul 21, 2008 08:53 AM by DkUltra
Jul 10, 2008 07:40 AM|kostisdive|LINK
We are working on a project that involves 2 websites (different applications) .
The second website must use different SQL Databases depending on which users logs in to the first website. The database is named "MGV_username" where "username" must be passed from the first website. So if there are 10 users the second application mus be
able to switch beteen "MGV_username1", "MGV_username2" .... "MGV_username10"
Since the "MGV_username" database is declared in the web.config and it is used by the ASP.NET Security and Nettiers Objects
My question is:
How can the first site redirect the client to the second website and then the second website change it's connectionstring depending on the "username" that the client provided on the first site?
Thank you !!!
Jul 10, 2008 08:08 AM|shihasnaas|LINK
i am not sure this is what u want...
step 1 :
before redirect ...insert the details provided by the first site to one common databse table with session id ...
step 2 :
redirect the page to one intermediate page in site2 by passing session id as parameter.....
step 3 :
fetch the user values from common databse table using session id and set the connection string using as per user...and redirect to proper page....
Jul 10, 2008 08:20 AM|kostisdive|LINK
thanks for your quick reply.
Let me make this more simple to understand
Think there is only one application which need to dynamically change the connectionstring in the global.asax or somewhere else i don't know.
for example if site is started http://website.com/default.aspx?user=user1 and the web.config connectionstring contains the "MGV_user" database
then it should automatically switch from "MGV_user" to "MGV_user1" database.
Jul 11, 2008 08:36 AM|shihasnaas|LINK
Jul 15, 2008 08:25 AM|DkUltra|LINK
Use a login view using the asp.net membership provider on each of the sites
Hope this helps
Jul 21, 2008 06:38 AM|kostisdive|LINK
Nobody seems to understand my problem.
SO, I WANT TO START AN ASP.NET APPLICATION FROM A WEB BROWSER , GIVING SOMEHOW THE DATABASENAME IT SHOULD USE INSTEAD OF THAT DECLARED IN THE CONNECTION STRING?
Can this be done?
Jul 21, 2008 08:53 AM|DkUltra|LINK
No, that is not possible using a single connection string. Use multiple connection strings.
1 string per database