Change the connection string in a WebSite
-
Hello, I am Silvia Terzi and I am quite new in asp .net. I have a very contingent and, at least I hope, banal problem. In my website I've built a login page where I give the possibility to the user, to choose the database he/she wants to enter, considering that I have 4 db (oracle) structurally identical but containing different datas. Inside the site then use various objects, like gridview and combobox, connected to db through SqlDatrasource. I've been able to do this thing and it seemed to work, but I have realized, that the change of connection string, instead of being only for session user, seems to work to global level. So, when an user changes connectionstring entering in the site, also changes connectionstring of the other users connected to the site from other computers. What I wrong?? I simply change the ConnectionString of the sqldatasource, but what's missing? Thank you to everyone who wants to help me. Regards, Silvia Terzi
-
Hello, I am Silvia Terzi and I am quite new in asp .net. I have a very contingent and, at least I hope, banal problem. In my website I've built a login page where I give the possibility to the user, to choose the database he/she wants to enter, considering that I have 4 db (oracle) structurally identical but containing different datas. Inside the site then use various objects, like gridview and combobox, connected to db through SqlDatrasource. I've been able to do this thing and it seemed to work, but I have realized, that the change of connection string, instead of being only for session user, seems to work to global level. So, when an user changes connectionstring entering in the site, also changes connectionstring of the other users connected to the site from other computers. What I wrong?? I simply change the ConnectionString of the sqldatasource, but what's missing? Thank you to everyone who wants to help me. Regards, Silvia Terzi
-
Use Session Variable to store the Connection String. It is limited to single user. Session["VarName"] = <connectionString>; string strCon = Session["VarName"].ToString();
Regards Aman Bhullar www.arlivesupport.com[^]
Thank you very much, it works. There is only one problem; if I open two different pages of internet in my computer, it doesn't work. I know that if I open the page with "New Session" it works, but i'd like to do it only opening a new page of internet. Any idea? Thanks, Silvia