dotConnect for Google BigQuery Documentation
Devart.Data.BigQuery Namespace / BigQueryCommand Class / Connection Property
Example

On this page
    Connection Property (BigQueryCommand)
    On this page
    Gets or sets the BigQueryConnection used by this instance of the BigQueryCommand.
    Syntax
    'Declaration
     
    Public Shadows Property Connection As BigQueryConnection
    public new BigQueryConnection Connection {get; set;}

    Property Value

    The connection to a data source. The default value is a null reference.
    Remarks

    BigQueryConnection specified in this property will carry out all operations executed with this BigQueryCommand.

    Example
    The following example creates a BigQueryCommand and sets some of its properties.
    public void CreateCommand()
    {
      string mySelectQuery = "SELECT * FROM your_project.your_dataset.employees ORDER BY id";
      BigQueryCommand bigQueryCommand = new BigQueryCommand(mySelectQuery);
      bigQueryCommand.Connection = new BigQueryConnection(
        @"Authentication Type=ServiceAccount;ServiceAccount Json=C:\keys\service-account.json;Project Id=your_project;DataSet Id=your_dataset;License Key=**********");
      bigQueryCommand.CommandType = System.Data.CommandType.Text;
    }
    Public Sub CreateCommand()
      Dim mySelectQuery As String = _
        "SELECT * FROM your_project.your_dataset.employees ORDER BY id"
      Dim bigQueryCommand As New BigQueryCommand(mySelectQuery)
      bigQueryCommand.Connection = New BigQueryConnection( _
        "Authentication Type=ServiceAccount;ServiceAccount Json=C:\keys\service-account.json;Project Id=your_project;DataSet Id=your_dataset;License Key=**********")
      bigQueryCommand.CommandType = System.Data.CommandType.Text
    End Sub
    See Also