Find this DLL first, by default in the installation directory of Visual Studio: "Microsoft Visual Studio 12.0\common7\ide\"
Find these two DLLs:
"Microsoft.Data.ConnectionUI.Dialog.dll"
"Microsoft.Data.ConnectionUI.dll"
Reference them two in the assembly, and then add a using reference
using Microsoft.Data.ConnectionUI;
In the case where you need to use the dialog box, you can use it.
varDialog =NewDataconnectiondialog ();//add only SQL Server connectionsdialog. Datasources.add (Datasource.sqldatasource);//Add all connections (including SQL server,oracle,acess, etc.)//datasource.addstandarddatasources (dialog);Dialog. Selecteddatasource =Datasource.sqldatasource;dialog. Selecteddataprovider=Dataprovider.sqldataprovider;dialog. ConnectionString=connectionString;if(DialogResult.OK = =dataconnectiondialog.show (Dialog)) {connectionString=Dialong. ConnectionString;}
Use the Visual Studio's own Database connection string dialog box