Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. Web Development
  3. Change the connection string in a WebSite

Change the connection string in a WebSite

Scheduled Pinned Locked Moved Web Development
databasehelpcsharporaclequestion
3 Posts 2 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • S Offline
    S Offline
    SIlviaTerzi
    wrote on last edited by
    #1

    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

    L 1 Reply Last reply
    0
    • S SIlviaTerzi

      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

      L Offline
      L Offline
      Lost User
      wrote on last edited by
      #2

      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[^]

      S 1 Reply Last reply
      0
      • L Lost User

        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[^]

        S Offline
        S Offline
        SIlviaTerzi
        wrote on last edited by
        #3

        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

        1 Reply Last reply
        0
        Reply
        • Reply as topic
        Log in to reply
        • Oldest to Newest
        • Newest to Oldest
        • Most Votes


        • Login

        • Don't have an account? Register

        • Login or register to search.
        • First post
          Last post
        0
        • Categories
        • Recent
        • Tags
        • Popular
        • World
        • Users
        • Groups