CreateCommand Method (SnowflakeConnection)
Creates and returns a
SnowflakeCommand object associated with the
SnowflakeConnection.
In this sample
SnowflakeCommand object is created. It is automatically associated with
SnowflakeConnection that created it.
|
|---|
public void CreateSnowflakeCommand(string myConnString)
{
SnowflakeConnection snowflakeConnection = new SnowflakeConnection(myConnString);
SnowflakeCommand snowflakeCommand = snowflakeConnection.CreateCommand();
snowflakeCommand.CommandText = "INSERT INTO your_database.your_schema.employees (first_name, last_name) VALUES ('John', 'Smith')";
snowflakeConnection.Open();
try
{
snowflakeCommand.ExecuteNonQuery();
}
finally
{
snowflakeConnection.Close();
}
} |
|
|---|
Public Sub CreateSnowflakeCommand(ByVal myConnString As String)
Dim snowflakeConnection As New SnowflakeConnection(myConnString)
Dim snowflakeCommand As SnowflakeCommand = snowflakeConnection.CreateCommand()
snowflakeCommand.CommandText = "INSERT INTO your_database.your_schema.employees (first_name, last_name) VALUES ('John', 'Smith')"
snowflakeConnection.Open()
Try
snowflakeCommand.ExecuteNonQuery()
Finally
snowflakeConnection.Close()
End Try
End Sub |