Choosing connectionstring in VB.NET application at startup

Posted by MatsT on Stack Overflow See other posts from Stack Overflow or by MatsT
Published on 2010-04-27T12:20:15Z Indexed on 2010/04/27 12:23 UTC
Read the original article Hit count: 281

I have a VB.NET application with a connection to an SQL Server 2003. On the server there are two databases, MyDatabase and MyDatabase_Test. What I would like to do is to show a dialog when the program starts that let's the user choose which database to use. My idea is to create a new form as the starup form that sets this property and then launches the main form.

Currently the connectionstring is specified in the application config file. Best would be if I can specify two different connection strings in that file to choose from, but for now it is also acceptable with other solutions like hardcoding the two connectionstrings into the startup form.

© Stack Overflow or respective owner

Related posts about vb.net

Related posts about connection-string