Question Locked

Visual Basic.NET connection strings

0 helpful
2 replies
Closed to new repliesThis discussion is closed. It stays readable, but it takes no new replies.

How do I set a Connection String as the default string in the Settings tab of a VS2005\VB.NET project's properties page?

I can have several connection strings, useful for switching between Live and Development machines, but how do I specify which one is the default at a given time? Currently having to change the value for a single string which is a pain.

Regards,

YaHozna.

2 replies

by tony hopkinson

My chosen method is not to put in connectionstrings in at all, I supply mine via the command line.
It's fairly easy to knock up a class to decode the command line params and then expose them via various methods.
Install and run then simply becomes a matter of creating shortcuts.
At design time you just stick them in the project settings.

The project settings option is only useful if there's only one per project as far as I'm concerned.

If it's not acceptable to alwayss have to put them in. Then put the one you want to use most in through an app.config file (becomes app.exex.config on deploy and override at teh commndline.

For Cthulu's sake don't put the user name and password in there though.

This discussion is closed to new replies.