dotConnect for Google BigQuery Documentation
Devart.Data.BigQuery Namespace / BigQueryCommand Class / BigQueryCommand Constructor / BigQueryCommand Constructor(String,BigQueryConnection)
The text of the query.
A BigQueryConnection object that represents the connection to Google BigQuery.
Example

On this page
    BigQueryCommand Constructor(String,BigQueryConnection)
    On this page
    Initializes a new instance of the BigQueryCommand class with the text of the query and a BigQueryConnection object.
    Syntax
    'Declaration
     
    Public Function New( _
       ByVal commandText As String, _
       ByVal connection As BigQueryConnection _
    )
    public BigQueryCommand( 
       string commandText,
       BigQueryConnection connection
    )

    Parameters

    commandText
    The text of the query.
    connection
    A BigQueryConnection object that represents the connection to Google BigQuery.
    Remarks
    The following table shows initial property values for an instance of BigQueryCommand.
    Properties Initial value
    CommandText commandText
    CommandTimeout 30
    CommandType System.Data.CommandType.Text
    Connection connection
    Example
    The following example creates a BigQueryCommand and sets some of its properties.
    public void CreateCommand()
    {
      BigQueryConnection bigQueryConnection = new BigQueryConnection(
          @"Authentication Type=ServiceAccount;ServiceAccount Json=C:\keys\service-account.json;Project Id=your_project;DataSet Id=your_dataset;License Key=**********");
      string mySelectQuery = "SELECT * FROM your_project.your_dataset.employees";
      BigQueryCommand bigQueryCommand = new BigQueryCommand(mySelectQuery, bigQueryConnection);
      bigQueryCommand.FetchSize = 100;
    }
    Public Sub CreateCommand()
      Dim bigQueryConnection As New BigQueryConnection( _
        "Authentication Type=ServiceAccount;ServiceAccount Json=C:\keys\service-account.json;Project Id=your_project;DataSet Id=your_dataset;License Key=**********")
      Dim mySelectQuery As String = _
        "SELECT * FROM your_project.your_dataset.employees"
      Dim bigQueryCommand As New BigQueryCommand(mySelectQuery, bigQueryConnection)
      bigQueryCommand.FetchSize = 100
    End Sub
    See Also