.netsql-servervisual-studiocommon-dialog

Common Dialog for selecting a SQL Server and getting login details?


My application needs to ask the user what SQL Server to connect to and what credentials to use for the connection, and I was wondering if there's a dialog box out there that somebody has already built - functioning like the OpenFileDialog that comes with the framework (in that you .Show it, then you can ask it which file was picked), but looking like the login box from SQL Management Studio.

Ideally, I'd .Show the dialog, and then once it finished, I could get a .ConnectionString property that returned the string associated with all the details they picked.

If once doesn't exist, I'd like to start the process to create it, because I imagine it would be helpful for people to just be able to drop on a form and have getting a database connection from the user taken care of.


Solution

  • Yes, the 'Connection Properties' dialog box that is used within Visual Studio is also available as a stand-alone component:

    http://code.msdn.microsoft.com/Connection

    alt text