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