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 magentoConnection = new MagentoConnection(myConnString);
MagentoCommand magentoCommand = magentoConnection.CreateCommand();
magentoCommand.CommandText = "INSERT INTO Customers (email, firstname, lastname) VALUES ('[email protected]', 'John', 'Smith')";
magentoConnection.Open();
try
{
magentoCommand.ExecuteNonQuery();
}
finally
{
magentoConnection.Close();
}
} |
|
|---|
Public Sub CreateMagentoCommand(ByVal myConnString As String)
Dim magentoConnection As New MagentoConnection(myConnString)
Dim magentoCommand As MagentoCommand = magentoConnection.CreateCommand()
magentoCommand.CommandText = "INSERT INTO Customers (email, firstname, lastname) VALUES ('[email protected]', 'John', 'Smith')"
magentoConnection.Open()
Try
magentoCommand.ExecuteNonQuery()
Finally
magentoConnection.Close()
End Try
End Sub |