dotConnect for Snowflake Documentation
Devart.Data.Snowflake Namespace / SnowflakeCommand Class / SnowflakeCommand Constructor / SnowflakeCommand Constructor(String,SnowflakeConnection)
The text of the query.
A SnowflakeConnection object that represents the connection to Snowflake.
Example

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

    Parameters

    commandText
    The text of the query.
    connection
    A SnowflakeConnection object that represents the connection to Snowflake.
    Remarks
    The following table shows initial property values for an instance of SnowflakeCommand.
    Properties Initial value
    CommandText commandText
    CommandTimeout 3600
    CommandType System.Data.CommandType.Text
    Connection connection
    Example
    The following example creates a SnowflakeCommand and sets some of its properties.
    public void CreateCommand()
    {
      SnowflakeConnection snowflakeConnection = new SnowflakeConnection(
          "Domain=myorg-myaccount.snowflakecomputing.com;User=your_user;Password=********;Database=your_database;Schema=your_schema;Warehouse=your_warehouse;License Key=**********");
      string mySelectQuery = "SELECT * FROM your_database.your_schema.employees";
      SnowflakeCommand snowflakeCommand = new SnowflakeCommand(mySelectQuery, snowflakeConnection);
    }
    Public Sub CreateCommand()
      Dim snowflakeConnection As New SnowflakeConnection( _
        "Domain=myorg-myaccount.snowflakecomputing.com;User=your_user;Password=********;Database=your_database;Schema=your_schema;Warehouse=your_warehouse;License Key=**********")
      Dim mySelectQuery As String = _
        "SELECT * FROM your_database.your_schema.employees"
      Dim snowflakeCommand As New SnowflakeCommand(mySelectQuery, snowflakeConnection)
    End Sub
    See Also