ArcObjects Library Reference (GeoDatabase)  

IFeatureClass.Update Method

Returns a cursor that can be used to update features selected by the specified query.

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

Parameters

filter [in]

  filter 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.

Remarks

Update opens an update cursor on the features specified by an attribute and/or spatial query as specified by the filter parameter. If a number of features selected by a particular query are to be updated and each feature is to be updated to a separate value then the update cursor is faster than doing an individual feature level update for each feature. The update is performed on the current 'cursor position'.

Update cursors can be used on instances of Feature subclasses (such as network features), with guaranteed polymorphic behavior. Update cursors can be used either inside or outside of an edit session. If used inside an edit session, the changes are not committed to the base table until the edit session is saved. Network feature classes, Topology feature classes, feature classes that participate in composite relationships or other relationships with messaging may only be updated within an edit session. If you attempt to use an update cursor on one of these classes outside of an edit session, it will fail.  In addition, edits to features that participate in a Topology or Geometric Network must be bracketed within an edit operation.

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

IFeatureClass Interface | IFeatureCursor Interface | IFeature Interface

.NET Samples

Calculate area geoprocessing function tool (Code Files: CalculateAreaFunction) | Get and set key properties on a mosaic dataset (Code Files: GetSetKeyProperty)

.NET Related Topics

Updating attributes of existing features