Using the arcobjects SDK (10.7.1) I am simply trying to count the number of features returned by a feature service query, here is some sample code:
IMapServer3 ms = (IMapServer3) this.mapServerDataAccess;
...
// query for relevant features using spatial filter
QueryResult queryResult = (QueryResult) ms.queryData(mapName,
getTableDescription(mapServerInfo, layerId),
spatialFilter, qResultOptions);
RecordSet rs = (RecordSet) queryResult.getObject();
I can count the number of features returned by getting a cursor and iterating through the cursor items incrementing a counter along the way but this is extremely slow and when working with layers with 2+ million points this is not feasable. Is there a way of getting the count of the number of features in the returned RecordSet? I couldn't see anything obvious.
Appreciate your help.
If you use a IRecordSet2 class, it has the Table property. You should be able to use the ITable's RowCount method.
Thanks Ken, I'll give that a try!!