dotConnect for Google BigQuery Documentation
Devart.Data.BigQuery Namespace / BigQueryConnection Class / Open Method
Example

On this page
    Open Method (BigQueryConnection)
    On this page
    Opens a Google BigQuery connection with the property settings specified by the ConnectionString.
    Syntax
    'Declaration
     
    Public Overrides Sub Open() 
    public override void Open()
    Remarks
    The BigQueryConnection draws an open connection from the connection pool if one is available. Otherwise, it establishes a new connection to the data source.

    Note: If the BigQueryConnection goes out of scope, the connection it represents does not close automatically. Therefore, you must explicitly close the connection by calling Devart.Common.DbConnectionBase.Close.

    Opening an open connection does nothing.

    Example
    The following example creates a BigQueryConnection, opens it, displays some of its properties, and then closes the connection.
    public void CreateBigQueryConnection(string myConnString)
    {
      BigQueryConnection bigQueryConnection = new BigQueryConnection(myConnString);
      bigQueryConnection.Open();
      MessageBox.Show("ServerVersion: " + bigQueryConnection.ServerVersion
        + "\nState: " + bigQueryConnection.State.ToString());
      bigQueryConnection.Close();
    }
    Public Sub CreateBigQueryConnection(myConnString As String)
      Dim bigQueryConnection As New BigQueryConnection(myConnString)
      bigQueryConnection.Open()
      MessageBox.Show("ServerVersion: " + bigQueryConnection.ServerVersion _
        + ControlChars.Cr + "State: " + bigQueryConnection.State.ToString())
      bigQueryConnection.Close()
    End Sub
    See Also