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','smithj@test1.com')";
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','smithj@test1.com')"
bigcommerceConnection.Open()
Try
bigcommerceCommand.ExecuteNonQuery()
Finally
bigcommerceConnection.Close()
End Try
End Sub
Target Platforms: Windows 7, Windows Vista SP1 or later, Windows XP SP3, Windows Server 2008 (Server Core not supported), Windows Server 2008 R2 (Server Core supported with SP1 or later), Windows Server 2003 SP2