ConnectionDialog.TryToConnect(IWin32Window, UIConnectionInfo, IDbConnection) Method

Definition

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

DialogResult

The database connection to be connected.

Applies to