ArcGIS Pro 3.3 API Reference Guide
ArcGIS.Core.Data Namespace / QueryFilter Class / RowCount Property
Example

In This Topic
    RowCount Property (QueryFilter)
    In This Topic
    Gets or sets the limit to the number of rows returned by the query.
    Syntax
    public int RowCount {get; set;}
    Public Property RowCount As Integer
    Remarks

    Some datastores support pagination only through an SQL postfix clause; in these cases, the PostfixClause property should be used in conjunction with RowCount.

    In FSDB, if ObjectIDs property is set, the RowCount value will be ignored for the better performance.

    Example
    Pagination in QueryFilter
    public void QueryFilterWithPagination(Table table, List<long> objectIDs)
    {
      int rowsPerBatch = 100;
      int offset = 0;
    
      // Query filter
      // Some datastores support pagination only through an SQL postfix clause
      QueryFilter queryFilter = new QueryFilter()
      {
        ObjectIDs = objectIDs,
        PostfixClause = "ORDER BY OBJECTID"
      };
    
      // Fetch rows in a batch from a table
      for (int index = offset; index <= objectIDs.Count; index += rowsPerBatch)
      {
        // Set number of rows to return from a table
        queryFilter.RowCount = rowsPerBatch;
    
        // Set positional offset to skip number of rows from a table 
        queryFilter.Offset = index;
          
        using (RowCursor cursor = table.Search(queryFilter))
        {
          while (cursor.MoveNext())
          {
            using (Row row = cursor.Current)
            {
              Console.WriteLine(row.GetObjectID());
            }
          }
        }
      }
    }
    
    Requirements

    Target Platforms: Windows 11, Windows 10

    ArcGIS Pro version: 3.3 or higher.
    See Also