dotConnect for QuickBooks Online Documentation
Devart.Data.QuickBooks Namespace / QuickBooksCommand Class / QuickBooksCommand Constructor / QuickBooksCommand Constructor(String,QuickBooksConnection)
The text of the query.
A QuickBooksConnection object that represents the connection to QuickBooks Online.
Example

In This Topic
    QuickBooksCommand Constructor(String,QuickBooksConnection)
    In This Topic
    Initializes a new instance of the QuickBooksCommand class with the text of the query and a %% object.
    Syntax
    'Declaration
     
    Public Function New( _
       ByVal commandText As String, _
       ByVal connection As QuickBooksConnection _
    )
    public QuickBooksCommand( 
       string commandText,
       QuickBooksConnection connection
    )

    Parameters

    commandText
    The text of the query.
    connection
    A QuickBooksConnection object that represents the connection to QuickBooks Online.
    Remarks
    The following table shows initial property values for an instance of QuickBooksCommand.
    Properties Initial value
    CommandText commandText
    CommandTimeout 30
    CommandType System.Data.CommandType.Text
    Connection connection
    Example
    The following example creates a QuickBooksCommand and sets some of its properties.
    public void CreateCommand()
    {
      QuickBooksConnection quickBooksConnection = new QuickBooksConnection(
          "Company Id=1440905870;Refresh Token=AB11590759756UCO8O6CpRQcAMP00sIANafgS8Y4RN10rpLJNM;Token Server=file://D:\\temp\\QuickBooksToken.txt");
      string mySelectQuery = "SELECT * FROM Customer";
      QuickBooksCommand quickBooksCommand = new QuickBooksCommand(mySelectQuery, quickBooksConnection);
      quickBooksCommand.FetchSize = 100;
    }
    Public Sub CreateCommand()
      Dim quickBooksConnection As New QuickBooksConnection( _
        "Company Id=1440905870;Refresh Token=AB11590759756UCO8O6CpRQcAMP00sIANafgS8Y4RN10rpLJNM;Token Server=file://D:\\temp\\QuickBooksToken.txt")
      Dim mySelectQuery As String = _
        "SELECT * FROM Customer"
      Dim quickBooksCommand As New QuickBooksCommand(mySelectQuery, quickBooksConnection)
      quickBooksCommand.FetchSize = 100
    End Sub
    Requirements

    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

    See Also