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(ZohoConnection zohoConnection, int StartRow, int PageLength)
{
ZohoCommand zohoCommand = new ZohoCommand("SELECT AccountID, \"Account Name\", Phone FROM Accounts", zohoConnection);
zohoConnection.Open();
ZohoDataReader zohoReader = zohoCommand.ExecutePageReader(System.Data.CommandBehavior.Default,StartRow,PageLength);
try
{
while (zohoReader.Read())
{
Console.WriteLine(zohoReader.GetString(0) + ", " + zohoReader.GetString(1) + ", " + zohoReader.GetString(2));
}
}
finally
{
zohoReader.Close();
zohoConnection.Close();
}
} |
|
|---|
Public Sub ExecutePaged(ByVal zohoConnection As ZohoConnection, ByVal StartRow As Integer, ByVal PageLength As Integer)
Dim zohoCommand As New ZohoCommand("SELECT AccountID, \"Account Name\", Phone FROM Accounts", zohoConnection)
zohoConnection.Open()
Dim zohoReader As ZohoDataReader = zohoCommand.ExecutePageReader(System.Data.CommandBehavior.Default, StartRow, PageLength)
Try
While zohoReader.Read()
Console.WriteLine(zohoReader.GetString(0) + ", " _
+ zohoReader.GetString(1) + ", " _
+ zohoReader.GetString(2))
End While
Finally
zohoReader.Close()
zohoConnection.Close()
End Try
End Sub |