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. ASP.NET
  4. Environment Independent Connection Strings

Environment Independent Connection Strings

Scheduled Pinned Locked Moved ASP.NET
questionhelpworkspace
4 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.
  • R Offline
    R Offline
    robert110
    wrote on last edited by
    #1

    How can I dynamically determine which environment my code is running in? For instance I would like for my apps to dynamically determine if they need to use the DEV connection strings or Production connection strings (within my DAL). By doing so I would avoid having to manually edit connection strings every time I make changes to my app. Appreciate your help.

    E 1 Reply Last reply
    0
    • R robert110

      How can I dynamically determine which environment my code is running in? For instance I would like for my apps to dynamically determine if they need to use the DEV connection strings or Production connection strings (within my DAL). By doing so I would avoid having to manually edit connection strings every time I make changes to my app. Appreciate your help.

      E Offline
      E Offline
      ednrgc
      wrote on last edited by
      #2

      Why don't you have a web.config for dev, and another one for production?

      R 1 Reply Last reply
      0
      • E ednrgc

        Why don't you have a web.config for dev, and another one for production?

        R Offline
        R Offline
        robert110
        wrote on last edited by
        #3

        I am not sure if that would work because when we will publish the website the development copy of web.config will be promoted to production:( Or am I missing something? Thanks for your help.

        E 1 Reply Last reply
        0
        • R robert110

          I am not sure if that would work because when we will publish the website the development copy of web.config will be promoted to production:( Or am I missing something? Thanks for your help.

          E Offline
          E Offline
          ednrgc
          wrote on last edited by
          #4

          Don't publish the web.config. That's how we all do it.

          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