Switching between Development and live

B

Brian

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
 
M

Michel Posseth [MCP]

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
 
H

Harry

Brian said:
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
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top