ArcGIS Pro 3.6 API Reference Guide
ArcGIS.Core.Data Namespace / Table Class / GetCount Method / GetCount() Method
Example

In This Topic
    GetCount() Method
    In This Topic
    Gets the count of how many rows are currently in this Table. This method must be called on the MCT. Use QueuedTask.Run.
    Syntax
    public long GetCount()
    Public Overloads Function GetCount() As Long

    Return Value

    The number of rows in this table.
    Exceptions
    ExceptionDescription
    A geodatabase-related exception has occurred.
    Example
    Gets the count of a Table or FeatureClass
    //Note: call within QueuedTask.Run()
    // Row count in a Table
    Table table = featureLayer.GetTable();
            long count = table.GetCount();
    
    // Feature count in a FeatureClass
    FeatureClass featureClass = featureLayer.GetFeatureClass();
    long nCount = featureClass.GetCount();
    Requirements

    Target Platforms: Windows 11, Windows 10

    ArcGIS Pro version: 3.0 or higher.
    See Also