General dialog for choosing SQL Server and getting login information?

My application should ask the user what SQL Server is connecting to and what credentials to use to connect, and I was wondering if there is a dialog box that someone already created is like OpenFileDialog that comes with the framework (in this you Show it, then you can ask which file was selected), but it looks like the login window in SQL Management Studio.

Ideally, I would look at the dialog, and then, once it is finished, I could get the .ConnectionString property, which returned a string associated with all the details that they selected.

If one time does not exist, I would like to start the process to create it, because I think it would be useful so that people just could give up the form and get concern about the database connection from the user.

+6
sql-server visual-studio
source share
3 answers

Yes, the Connection Properties dialog box used in Visual Studio is also available as a separate component:

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

alt text

+6
source share

Not that I know, however it should be pretty easy to hack one, and you can use SQL Server SMO objects that should have all the necessary methods.

http://msdn.microsoft.com/en-us/library/ms162169.aspx

0
source share

I do not have it, because usually the application in production is included in one sql server, so they enter only their user ID and pwd.

Should they have access to any sql server or are there business terms that you could use to hide the actual server name?

Say your application needs to know if they want to log in to the dev, test or prod server. You can have a drop-down list with these 3 values ​​and search somewhere on the server names. Then you just need the standard userID and pwd identifiers.

0
source share

All Articles