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


IFeatureLayer2.Search Method (ArcObjects .NET 10.4 SDK)
ArcObjects Library Reference (Carto)  

IFeatureLayer2.Search Method

Creates a cursor based upon the search criteria.

[Visual Basic .NET]
Public Function Search ( _
    ByVal queryFilter As IQueryFilter, _
    ByVal recycling As Boolean _
) As IFeatureCursor
[C#]
public IFeatureCursor Search (
    IQueryFilter queryFilter,
    bool recycling
);
[C++]
HRESULT Search(
  IQueryFilter* queryFilter,
  VARIANT_BOOL recycling,
  IFeatureCursor** Cursor
);
[C++]

Parameters queryFilter [in]
queryFilter is a parameter of type IQueryFilter recycling [in] recycling is a parameter of type VARIANT_BOOL Cursor [out, retval]
Cursor is a parameter of type IFeatureCursor

Product Availability

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

Description

Use this method to return a read-only cursor of the layer's features.

Remarks

If there is a definition query set on the layer, the Search method will automatically work on the subset of features in the layer that meet the definition criteria. You specify an additional query that will be applied after the layer's definition query by passing valid IQueryFilter object for the QueryFilter parameter.

This Search method will not work on joined fields. If the FeaureLayer has any joins, you should use the IGeoFeatureLayer::SeachDisplayFeatures method instead.

You cannot use the cursor returned by IFeatureLayer::Search to update features, instead use IFeatureClass::Update.

Recycling specifies whether the resulting feature cursor will be recycling or non-recycling. Use True for recycling cursor and False for a non-recycling cursor. See the topic for IFeatureClass::Search for more information.

See Also

IFeatureLayer2 Interface