Switching between Development and live

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • Brian

    Switching between Development and live

    Hello,
    I have an app where I am switching between development mode and live mode,
    phyically seperate networks. What I would like to try and figure out is,
    how can I have my app know which db server to hit? Right now, I just change
    the connection string information that I have stored in the Settings....
    These are SQL 2005 databases and the only difference is the Data Source.
    Thanks,
    Brian


  • Michel Posseth  [MCP]

    #2
    Re: Switching between Development and live


    In the company i work for we have 3 DB systems
    Production , Test and Development

    sometimes we want to switch to another server , we solved this by changing
    the hosts file ( we made a nice menu for this )

    HTH


    Michel Posseth [MCP]




    "Brian" <bsgallatin@com munity.nospamsc hreef in bericht
    news:%23nG5tvvK JHA.4324@TK2MSF TNGP05.phx.gbl. ..
    Hello,
    I have an app where I am switching between development mode and live mode,
    phyically seperate networks. What I would like to try and figure out is,
    how can I have my app know which db server to hit? Right now, I just
    change
    the connection string information that I have stored in the Settings....
    These are SQL 2005 databases and the only difference is the Data Source.
    Thanks,
    Brian
    >

    Comment

    • Harry

      #3
      Re: Switching between Development and live

      "Brian" <bsgallatin@com munity.nospamwr ote in message
      news:%23nG5tvvK JHA.4324@TK2MSF TNGP05.phx.gbl. ..
      Hello,
      I have an app where I am switching between development mode and live mode,
      phyically seperate networks. What I would like to try and figure out is,
      how can I have my app know which db server to hit? Right now, I just
      change
      the connection string information that I have stored in the Settings....
      These are SQL 2005 databases and the only difference is the Data Source.
      Thanks,
      Brian
      >
      You could use the foloowing:

      If System.Diagnost ics.Debugger.Is Attached Then 'check if running in IDE

      If My.Settings.Tes tMode Then

      DB = My.Settings.DB8 _Test

      lblDB.Text = "DB: DB8_Test"

      lblDB.ForeColor = Color.Blue

      Else

      DB = My.Settings.DB8

      lblDB.Text = "DB: DB8"

      lblDB.ForeColor = Color.Red

      End If

      Else

      DB = My.Settings.DB8

      lblDB.Text = "DB: DB8"

      lblDB.ForeColor = Color.Red

      End If


      Comment

      Working...