<p>I would like to offer a database connection prompt to the user. I can build my own, but it would be nice if I can use something that somebody else has already built (maybe something built into Windows or a free library available on the Internet). Anybody know how to do this in .Net?</p>

<p><strong>EDIT:</strong> I found this and thought it was interesting: <a href="http://weblogs.asp.net/jgalloway/archive/2006/10/29/Showing-a-Connection-String-prompt-in-a-WinForm-application.aspx" rel="nofollow noreferrer">Showing a Connection String prompt in a WinForm application</a>. This only works for SQL Server connections though.</p>

[{'answer_id': 53189, 'author': 'Gulzar Nazim', 'author_id': 4337, 'author_profile': 'https://Stackoverflow.com/users/4337', 'pm_score': 5, 'selected': True, 'text': '<p>You might want to try using <a href="http://msdn.microsoft.com/en-us/magazine/cc163409.aspx" rel="nofollow noreferrer">SQL Server Management Objects</a>. This MSDN article has a good sample for prompting and connecting to a SQL server.</p>\n'}, {'answer_id': 53194, 'author': 'FlySwat', 'author_id': 1965, 'author_profile': 'https://Stackoverflow.com/users/1965', 'pm_score': 2, 'selected': False, 'text': '<p>ADO.NET has the handy ConnectionStringBuilder which will construct and validate a connection string. This would at least take the grunt work out of one part, allowing you to create a simple dialog box for the input.</p>\n'}, {'answer_id': 53196, 'author': 'Jon Limjap', 'author_id': 372, 'author_profile': 'https://Stackoverflow.com/users/372', 'pm_score': 0, 'selected': False, 'text': '<p>The only "built in" connection string functionality that I could think of is the one that comes up when you run a CMD script (essentially a batch file) that runs SQL scripts. However I\'m not sure if it\'s something built into Visual Studio.</p>\n\n<p>It\'s really simple to make one anyway. If you don\'t want the user to be able to input a straight-out connection string, you can put together one made up of four textboxes and a checkbox:</p>\n\n<ul>\n<li>Server</li>\n<li>Catalog Name</li>\n<li>checkbox for integrated security or SQL Authentication</li>\n<li>Username</li>\n<li>Password</li>\n</ul>\n\n<p>Fairly trivial, IMHO.</p>\n'}, {'answer_id': 1125101, 'author': 'jan', 'author_id': 1163, 'author_profile': 'https://Stackoverflow.com/users/1163', 'pm_score': 1, 'selected': False, 'text': '<p>I combined the <a href="http://msdn.microsoft.com/en-us/library/system.windows.forms.propertygrid.aspx" rel="nofollow noreferrer">PropertyGrid Class</a> with the <a href="http://msdn.microsoft.com/en-us/library/system.data.sqlclient.sqlconnectionstringbuilder.aspx" rel="nofollow noreferrer">SqlConnectionStringBuilder Class</a> in a separate dialog and that <a href="https://stackoverflow.com/questions/1103637/usercontrol-to-connect-to-a-sqlserver-database">worked</a> really well for me.</p>\n'}, {'answer_id': 5003418, 'author': 'Örjan Jämte', 'author_id': 19311, 'author_profile': 'https://Stackoverflow.com/users/19311', 'pm_score': 2, 'selected': False, 'text': '<p>Microsoft has released the source code for the data connection dialog on Code Gallery.</p>\n\n<p>Here is an <a href="http://blogs.msdn.com/b/vsdata/archive/2010/02/02/data-connection-dialog-source-code-is-released-on-code-gallery.aspx" rel="nofollow">blog post from Yaohai</a> with more info and here is <a href="http://code.msdn.microsoft.com/Connection" rel="nofollow">the home of Data Connection Dialog on Code Gallery</a>.</p>\n'}]
['https://Stackoverflow.com/questions/53178', 'https://Stackoverflow.com', 'https://Stackoverflow.com/users/320/']