What you want to do is not nice. I take it that you want the user to specify a connection string at installation and persist this to your program. Well, this is not a good thing to do, and connections strings are liable to change; with this in mind you need to include a connection string dialog in your code or at least a text box where the user can set a new connection string that your application can use.
You could use the VS2010 database connection dialog that Microsoft have released (download from here). This will do exactly what you want without you having to do the hard work (and for pretty much any remote connection you want).
I hope this helps.