ConnectionDialog.TryToConnect Method
Definition
Important
Some information relates to prerelease product that may be substantially modified before it’s released. Microsoft makes no warranties, express or implied, with respect to the information provided here.
Opens the connection using a given connection info without showing any UI.
public:
System::Windows::Forms::DialogResult TryToConnect(System::Windows::Forms::IWin32Window ^ parent, Microsoft::SqlServer::Management::Smo::RegSvrEnum::UIConnectionInfo ^ % connectInfo, [Runtime::InteropServices::Out] System::Data::IDbConnection ^ % connection);
public System.Windows.Forms.DialogResult TryToConnect (System.Windows.Forms.IWin32Window parent, ref Microsoft.SqlServer.Management.Smo.RegSvrEnum.UIConnectionInfo connectInfo, out System.Data.IDbConnection connection);
member this.TryToConnect : System.Windows.Forms.IWin32Window * UIConnectionInfo * IDbConnection -> System.Windows.Forms.DialogResult
Public Function TryToConnect (parent As IWin32Window, ByRef connectInfo As UIConnectionInfo, ByRef connection As IDbConnection) As DialogResult
Parameters
- parent
- IWin32Window
The main server.
- connectInfo
- UIConnectionInfo
Connection info to use.
- connection
- IDbConnection
The SqlConnection.
Returns
The database connection to be connected.