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

ICursor Interface (ArcObjects .NET 10.8 SDK)
ArcObjects Help for .NET developers > ArcObjects Help for .NET developers > ArcObjects namespaces > Geodatabase > ESRI.ArcGIS.GeoDatabase > Interfaces > IC > ICursor Interface
ArcGIS Developer Help

ICursor Interface

Provides access to members that hand out enumerated rows, field collections and allows for the updating, deleting and inserting of rows.

Product Availability

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


Name Description
Method DeleteRow Delete the existing Row in the database corresponding to the current position of the cursor.
Read-only property Fields The Fields Collection for this cursor.
Method FindField The index of the field with the specified name.
Method Flush Flush any outstanding buffered writes to the database.
Method InsertRow Insert a new Row into the database using the property values in the input buffer. The object ID of the new Row, if there is one, is returned.
Method NextRow Advance the position of the cursor by one and return the Row object at that position.
Method UpdateRow Update the existing Row in the database corresponding to the current position of the cursor.

Classes that implement ICursor

Classes Description
Cursor Esri Cursor object.
FeatureCursor Esri Feature Cursor object.
RelQueryCursor A cursor that is opened from a RelQueryTable.
TemporalCursor (esriTrackingAnalyst) Controls settings for the temporal cursor.


Cursors are forward only; they do not support backing up and retrieving rows that have already been retrieved or making multiple passes over data. If an application needs to make multiple passes over the data, the application needs to reexecute the query that returned the cursor. If both executions of the query are made within the same edit session (or database transaction with the appropriate level of isolation), the application is guaranteed not to see any changes made to the data by other concurrently executing applications.

Note that while a cursor is created in the client's memory after a call to methods such as ITable.Search or ITable.Insert, the DBMS cursor is not created until a call to NextRow (or a similar method) is made. This is why retrieving the first row may take longer than subsequent rows, and because underlying DBMS errors might be raised on the call, error handling is recommended.

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.

.NET Samples

Create camera flyby from path Closest facility solver Export any network analysis class to a text file Location-allocation solver ArcGIS Network Analyst extension Engine application Origin-destination cost matrix solver Implementing extended criteria for some predefined schematic rules Service area solver Retrieve a color ramp from the SymbologyControl Vehicle routing problem solver