dotConnect for Snowflake Documentation
Devart.Data.Snowflake Namespace / SnowflakeCommand Class / Connection Property
Example

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

    Property Value

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

    SnowflakeConnection specified in this property will carry out all operations executed with this SnowflakeCommand.

    Example
    The following example creates a SnowflakeCommand and sets some of its properties.
    public void CreateCommand()
    {
      string mySelectQuery = "SELECT * FROM your_database.your_schema.employees ORDER BY id";
      SnowflakeCommand snowflakeCommand = new SnowflakeCommand(mySelectQuery);
      snowflakeCommand.Connection = new SnowflakeConnection(
        "Domain=myorg-myaccount.snowflakecomputing.com;User=your_user;Password=********;Database=your_database;Schema=your_schema;Warehouse=your_warehouse;License Key=**********");
      snowflakeCommand.CommandType = System.Data.CommandType.Text;
    }
    Public Sub CreateCommand()
      Dim mySelectQuery As String = _
        "SELECT * FROM your_database.your_schema.employees ORDER BY id"
      Dim snowflakeCommand As New SnowflakeCommand(mySelectQuery)
      snowflakeCommand.Connection = New SnowflakeConnection( _
        "Domain=myorg-myaccount.snowflakecomputing.com;User=your_user;Password=********;Database=your_database;Schema=your_schema;Warehouse=your_warehouse;License Key=**********")
      snowflakeCommand.CommandType = System.Data.CommandType.Text
    End Sub
    See Also