Connecting Tech Pros Worldwide Forums | Help | Site Map

Switching between Development and live

Brian
Guest
 
Posts: n/a
#1: Oct 10 '08
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]
Guest
 
Posts: n/a
#2: Oct 10 '08

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]
http://www.vbdotnetcoder.com



"Brian" <bsgallatin@community.nospamschreef in bericht
news:%23nG5tvvKJHA.4324@TK2MSFTNGP05.phx.gbl...
Quote:
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
>

Harry
Guest
 
Posts: n/a
#3: Oct 12 '08

re: Switching between Development and live


"Brian" <bsgallatin@community.nospamwrote in message
news:%23nG5tvvKJHA.4324@TK2MSFTNGP05.phx.gbl...
Quote:
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.Diagnostics.Debugger.IsAttached Then 'check if running in IDE

If My.Settings.TestMode 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


Closed Thread