Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations John Tel on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

VS 2005: Where to put SQL connection strings

Status
Not open for further replies.

TonyScarpelli

Programmer
Jan 23, 2003
361
US
I work on four different computers, three at home and one at work, each with a local SQL Server, and at work with a networked test and production SQL Server.

I bring my projects to each computer when I am working on them and so I have to use a different SQL connection for each.

In VB .NET 2003 I have a class that checks which computer I'm on, and in the Form Load event I pick the server and connection string I need for the project which I can pass on to other code that does the connection.

However, in 2005 it looks like the connection strings are put into the app.config file which is an xml file, and there is no way that I can see where I would put a case statement to choose the connection string I need.

So the question is, where would I put code to get the connection string I need for each of my working environments.

Thanks.


Tony Scarpelli
Clinical Engineering Dept.
Maine Medical Center
Portland, Maine 04102
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top