dotConnect for Google BigQuery Documentation
Devart.Data.BigQuery Namespace / BigQueryCommand Class / ExecuteReader Method / ExecuteReader(CommandBehavior) Method
One of the System.Data.CommandBehavior values.
Example

On this page
    ExecuteReader(CommandBehavior) Method
    On this page
    Sends the CommandText to the Connection, and builds a BigQueryDataReader using one of the System.Data.CommandBehavior values.
    Syntax
    'Declaration
     
    Public Overloads Shadows Function ExecuteReader( _
       ByVal behavior As CommandBehavior _
    ) As BigQueryDataReader
    public new BigQueryDataReader ExecuteReader( 
       CommandBehavior behavior
    )

    Parameters

    behavior
    One of the System.Data.CommandBehavior values.

    Return Value

    Example
    The following example creates a BigQueryCommand, then executes it by passing a string that is SQL SELECT statement, and a string to use to connect to the data source. The System.Data.CommandBehavior is then set to CloseConnection.
    public void CreateBigQueryDataReader(string mySelectQuery,string bigQueryConnectionString)
    {
      BigQueryConnection bigQueryConnection = new BigQueryConnection(bigQueryConnectionString);
      BigQueryCommand bigQueryCommand = new BigQueryCommand(mySelectQuery, bigQueryConnection);
      bigQueryCommand.Connection.Open();
      BigQueryDataReader bigQueryReader = bigQueryCommand.ExecuteReader(CommandBehavior.CloseConnection);
      while(bigQueryReader.Read())
      {
        Console.WriteLine(bigQueryReader.GetString(0));
      }
      bigQueryReader.Close();
    }
    Public Sub CreateBigQueryDataReader(mySelectQuery As String, _
    bigQueryConnectionString As String)
      Dim bigQueryConnection As New BigQueryConnection(bigQueryConnectionString)
      Dim bigQueryCommand As New BigQueryCommand(mySelectQuery, bigQueryConnection)
      bigQueryCommand.Connection.Open()
      Dim bigQueryReader As BigQueryDataReader = bigQueryCommand.ExecuteReader(CommandBehavior.CloseConnection)
      While bigQueryReader.Read()
        Console.WriteLine(bigQueryReader.GetString(0))
      End While
      bigQueryReader.Close()
    End Sub
    See Also