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


ISelectionSet.Search Method (ArcObjects .NET 10.5 SDK)
ArcObjects Library Reference (GeoDatabase)  

ISelectionSet.Search Method

Returns a cursor that can be used to retrieve the objects specified by a query over this selection set.

[Visual Basic .NET]
Public Sub Search ( _
    ByVal QueryFilter As IQueryFilter, _
    ByVal Recycling As Boolean, _
    ByRef Cursor As ICursor _
)
[C#]
public void Search (
    IQueryFilter QueryFilter,
    bool Recycling,
    ref ICursor Cursor
);
[C++]
HRESULT Search(
  IQueryFilter* QueryFilter,
  VARIANT_BOOL Recycling,
  ICursor** Cursor
);
[C++]

Parameters QueryFilter [in]
QueryFilter is a parameter of type IQueryFilter Recycling [in] Recycling is a parameter of type VARIANT_BOOL Cursor [out]
Cursor is a parameter of type ICursor

Product Availability

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

Remarks

Search will return an ICursor with all of the rows that satisfy the constraints specified by a query filter. If a null value is provided for the QueryFilter parameter, the cursor will contain all of the selection set's rows.

The Recycling parameter controls row object allocation behavior.

Recycling cursors rehydrate a single feature/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 feature/row object returned by a recycling cursor across multiple calls to NextRow on the cursor. Feature/Row objects returned by a recycling cursor should not be modified. Non-recycling cursors return a separate object on each fetch.

The features/rows returned by a non-recycling cursor may be modified and stored with polymorphic behavior. The geodatabase guarantees "unique instance semantics" on non-recycling feature/row objects fetched during an edit session. If the 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.

See Also

ISelectionSet Interface

.NET Snippets

Zoom to Selected Globe Features

.NET Samples

Custom reshape polyline edit task (Code Files: ReshapePolylineEditTask) | ArcGIS Network Analyst extension Engine application (Code Files: frmLoadLocations) | Create camera flyby from path (Code Files: frmCameraPath) | Migrating from VB6 to VB .NET for ArcGIS 10 (Code Files: ButtonAddIn clscopy_table_sel clsCopyTableSelection)

.NET Related Topics

How to zoom to selected features in globe | Migrating VB6 to VB.NET for ArcGIS 10