This document is archived and information here might be outdated.  Recommended version.

ITable.Search Method (ArcObjects .NET 10.8 SDK)
ArcObjects Help for .NET developers > ArcObjects Help for .NET developers > ArcObjects namespaces > Geodatabase > ESRI.ArcGIS.GeoDatabase > Interfaces > IT > ITable Interface > ITable.Search Method
ArcGIS Developer Help

ITable.Search Method

An object cursor that can be used to fetch row objects selected by the specified query.

[Visual Basic .NET]
Public Function Search ( _
    ByVal QueryFilter As IQueryFilter, _
    ByVal Recycling As Boolean _
) As ICursor
public ICursor Search (
    IQueryFilter QueryFilter,
    bool Recycling
  IQueryFilter* QueryFilter,
  VARIANT_BOOL Recycling
QueryFilter [in]

QueryFilter is a parameter of type IQueryFilter* Recycling [in]
Recycling is a parameter of type bool

Product Availability

Available with ArcGIS Engine, ArcGIS Desktop, and ArcGIS Server.


The Search method returns a search cursor that can be used to retrieve rows specified by a query filter. The recycling parameter controls row object allocation behavior. Recycling cursors rehydrate a single row object on each fetch and can be used to optimize read-only access, for example, when drawing. It is illegal to maintain a reference on a row object returned by a recycling cursor across multiple calls to NextRow on the cursor.

Row objects returned by a recycling cursor should not be modified. Non-recycling cursors return a separate row object on each fetch. The objects returned by a non-recycling cursor may be modified and stored with polymorphic behavior. The geodatabase guarantees �unique instance semantics� on non-recycling row objects fetched during an edit session. If the row object to be retrieved by a call to search has already been instantiated and is being referenced by the calling application, then a reference to the existing row object is returned.

Non-recycling feature cursors returned from the Search method *MUST* be used when copying features from the cursor into an insert cursor of another class.  This is because a recycling cursor reuses the same geometry and under some circumstances all of the features inserted into the insert cursor may have the same geometry.  Using a non-recycling cursor ensures that each geometry is unique.

When using cursors within an edit session, they should always be scoped to edit operations. In other words, a cursor should be created after an edit operation has begun and should not be used once that edit operation has been stopped or aborted.

See Also

ITable Interface

.NET Samples

Closest facility solver Export any network analysis class to a text file Location-allocation solver Origin-destination cost matrix solver Service area solver Vehicle routing problem solver