CreateCommand Method (BigcommerceConnection)
Creates and returns a
BigcommerceCommand object associated with the
BigcommerceConnection.
In this sample
BigcommerceCommand object is created. It is automatically associated with
BigcommerceConnection that created it.
|
|---|
public void CreateBigcommerceCommand(string myConnString)
{
BigcommerceConnection bigcommerceConnection = new BigcommerceConnection(myConnString);
BigcommerceCommand bigcommerceCommand = bigcommerceConnection.CreateCommand();
bigcommerceCommand.CommandText = "INSERT INTO customers (firstname, lastname, email) VALUES ('John','Smith','[email protected]')";
bigcommerceConnection.Open();
try
{
bigcommerceCommand.ExecuteNonQuery();
}
finally
{
bigcommerceConnection.Close();
}
} |
|
|---|
Public Sub CreateBigcommerceCommand(ByVal myConnString As String)
Dim bigcommerceConnection As New BigcommerceConnection(myConnString)
Dim bigcommerceCommand As BigcommerceCommand = bigcommerceConnection.CreateCommand()
bigcommerceCommand.CommandText = "INSERT INTO customers (firstname, lastname, email) VALUES ('John','Smith','[email protected]')"
bigcommerceConnection.Open()
Try
bigcommerceCommand.ExecuteNonQuery()
Finally
bigcommerceConnection.Close()
End Try
End Sub |