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
CODE PROJECT For Those Who Code
  • Home
  • Articles
  • FAQ
Community
  1. Home
  2. Web Development
  3. ASP.NET
  4. edit web.config file

edit web.config file

Scheduled Pinned Locked Moved ASP.NET
6 Posts 4 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.
  • R Offline
    R Offline
    Raghvendra Kumar Roy
    wrote on last edited by
    #1

    Hi all I have 5 databases.I want to connect them at runtime as the user's choice. is there any wayto edit web.config file at runtime to change connectionstring.it is very urgent plz reply me.

    Raghvendra Kumar Roy

    C P V 3 Replies Last reply
    0
    • R Raghvendra Kumar Roy

      Hi all I have 5 databases.I want to connect them at runtime as the user's choice. is there any wayto edit web.config file at runtime to change connectionstring.it is very urgent plz reply me.

      Raghvendra Kumar Roy

      C Offline
      C Offline
      Christian Graus
      wrote on last edited by
      #2

      Raghvendra Kumar Roy wrote:

      it is very urgent

      Of course it is.... You can add as many strings to your app config as you'd like. It would make more sense to store all the strings in your app config and add the functionality to select between them.

      Christian Graus - Microsoft MVP - C++ "I am working on a project that will convert a FORTRAN code to corresponding C++ code.I am not aware of FORTRAN syntax" ( spotted in the C++/CLI forum )

      R 1 Reply Last reply
      0
      • C Christian Graus

        Raghvendra Kumar Roy wrote:

        it is very urgent

        Of course it is.... You can add as many strings to your app config as you'd like. It would make more sense to store all the strings in your app config and add the functionality to select between them.

        Christian Graus - Microsoft MVP - C++ "I am working on a project that will convert a FORTRAN code to corresponding C++ code.I am not aware of FORTRAN syntax" ( spotted in the C++/CLI forum )

        R Offline
        R Offline
        Raghvendra Kumar Roy
        wrote on last edited by
        #3

        What i can do if i have to create anew connection string

        Raghvendra Kumar Roy

        C 1 Reply Last reply
        0
        • R Raghvendra Kumar Roy

          What i can do if i have to create anew connection string

          Raghvendra Kumar Roy

          C Offline
          C Offline
          Christian Graus
          wrote on last edited by
          #4

          Try putting them all in an XML file, and then you can access it from your app. I didn't realise your web app would have a constantly changing list of connections, that seems unusual.

          Christian Graus - Microsoft MVP - C++ "I am working on a project that will convert a FORTRAN code to corresponding C++ code.I am not aware of FORTRAN syntax" ( spotted in the C++/CLI forum )

          1 Reply Last reply
          0
          • R Raghvendra Kumar Roy

            Hi all I have 5 databases.I want to connect them at runtime as the user's choice. is there any wayto edit web.config file at runtime to change connectionstring.it is very urgent plz reply me.

            Raghvendra Kumar Roy

            P Offline
            P Offline
            Paddy Boyd
            wrote on last edited by
            #5

            You shouldn't have your system edit the web.config at runtime. Changing the web.config will cause the app domain to recycle - I imagine this could potentially cause you a few problems...

            1 Reply Last reply
            0
            • R Raghvendra Kumar Roy

              Hi all I have 5 databases.I want to connect them at runtime as the user's choice. is there any wayto edit web.config file at runtime to change connectionstring.it is very urgent plz reply me.

              Raghvendra Kumar Roy

              V Offline
              V Offline
              Vasudevan Deepak Kumar
              wrote on last edited by
              #6

              Raghvendra Kumar Roy wrote:

              edit web.config file at runtime

              High risk. Application restarts when web.config is updated. Not recommended.

              Vasudevan Deepak Kumar Personal Homepage Tech Gossips

              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