CreateCommand Method (QuickBooksConnection)
Creates and returns a
QuickBooksCommand object associated with the
QuickBooksConnection.
In this sample
QuickBooksCommand object is created. It is automatically associated with
QuickBooksConnection that created it.
public void CreateQuickBooksCommand(string myConnString)
{
QuickBooksConnection quickBooksConnection = new QuickBooksConnection(myConnString);
QuickBooksCommand quickBooksCommand = quickBooksConnection.CreateCommand();
quickBooksCommand.CommandText = "INSERT INTO Customer (DisplayName, Notes) VALUES ('John Smith', 'VIP Customer')";
quickBooksConnection.Open();
try
{
quickBooksCommand.ExecuteNonQuery();
}
finally
{
quickBooksConnection.Close();
}
}
Public Sub CreateQuickBooksCommand(ByVal myConnString As String)
Dim quickBooksConnection As New QuickBooksConnection(myConnString)
Dim quickBooksCommand As QuickBooksCommand = quickBooksConnection.CreateCommand()
quickBooksCommand.CommandText = "INSERT INTO Customer (DisplayName, Notes) VALUES ('John Smith', 'VIP Customer')"
quickBooksConnection.Open()
Try
quickBooksCommand.ExecuteNonQuery()
Finally
quickBooksConnection.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