Feature service QueryIDs method

Queries and returns the ObjectIDs of the features or objects that satisfy the search criteria.

int[] QueryIDs(long LayerOrTableID, string DefinitionExpression, QueryFilter QueryFilter, sting VersionName)




The identifier of a layer or table.


A type's definition expression.


Describes the features/objects to query based on attribute expressions, time and/or spatial filters.


Geodatabase version to query. This parameter applies only to feature services that expose geodatabases. If not specified, queries are made against the published map's version.

Return Value

This method returns an array of integer values which are the ObjectIDs of the features or objects returned by the query.


This method is useful when a query criterion returns too many objects for the client application to process or wait for. In such situations, a client can obtain the ObjectIDs of the features or objects that satisfy the criteria expressed in DefinitionExpression and QueryFilter. The client can then divide the object ids into smaller sets and query the service for each set using the Query method and passing in each ID set to the method's QueryFilter.FIDSet property.