Returns a specific subset of rows when paging through the results of a query.
The example below shows how to retrieve a part of a table. If this function is called with parameters
startRecord=2 and
maxRecords=3, it returns 3 rows: second, third, and fourth.
public void ExecutePaged(QuickBooksConnection quickBooksConnection, int StartRow, int PageLength)
{
QuickBooksCommand quickBooksCommand = new QuickBooksCommand("SELECT Id, DisplayName, Notes FROM Customer", quickBooksConnection);
quickBooksConnection.Open();
QuickBooksDataReader quickBooksReader = quickBooksCommand.ExecutePageReader(System.Data.CommandBehavior.Default,StartRow,PageLength);
try
{
while (quickBooksReader.Read())
{
Console.WriteLine(quickBooksReader.GetString(0) + ", " + quickBooksReader.GetString(1) + ", " + quickBooksReader.GetString(2));
}
}
finally
{
quickBooksReader.Close();
quickBooksConnection.Close();
}
}
Public Sub ExecutePaged(ByVal quickBooksConnection As QuickBooksConnection, ByVal StartRow As Integer, ByVal PageLength As Integer)
Dim quickBooksCommand As New QuickBooksCommand("SELECT Id, DisplayName, Notes FROM Customer", quickBooksConnection)
quickBooksConnection.Open()
Dim quickBooksReader As QuickBooksDataReader = quickBooksCommand.ExecutePageReader(System.Data.CommandBehavior.Default, StartRow, PageLength)
Try
While quickBooksReader.Read()
Console.WriteLine(quickBooksReader.GetString(0) + ", " _
+ quickBooksReader.GetString(1) + ", " _
+ quickBooksReader.GetString(2))
End While
Finally
quickBooksReader.Close()
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