"Brian" <bs********@community.nospamwrote in message
news:%2****************@TK2MSFTNGP05.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.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