Return Value
The number of rows in this table.
| Exception | Description |
|---|---|
| ArcGIS.Core.Data.Exceptions.GeodatabaseException | A geodatabase-related exception has occurred. |
{
//Must be called within QueuedTask.Run()
void GetCount(FeatureLayer featureLayer)
{
// Row count in a Table
Table table = featureLayer.GetTable();
long count = table.GetCount();
// Feature count in a FeatureClass
FeatureLayer lyr = MapView.Active.Map.GetLayersAsFlattenedList().OfType<FeatureLayer>().FirstOrDefault();
FeatureClass featureClass = lyr.GetFeatureClass();
count = featureClass.GetCount();
}
}
Target Platforms: Windows 11 Home, Pro, Enterprise (64 bit)