ArcObjects Library Reference (GeoDatabase)  

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.

Members

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.

CoClasses that implement ICursor

CoClasses and 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.

Remarks

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 Snippets

Zoom to Selected Globe Features | Load Network Locations | Perform Attribute Query |

.NET Samples

ArcGIS GPConsole (Code Files: Program) | Bind a geodatabase table to a .NET control (Code Files: TableWrapper) | Closest facility application using the NAServer extension in ArcGIS Server via a GIS server (Code Files: ClosestFacility_GISServerAPIClass) | Closest facility solver (Code Files: frmClosestFacilitySolver) | Create camera flyby from path (Code Files: frmCameraPath) | Export any network analysis class to a text file (Code Files: NAClassToTextfileCmd) | Implementing extended criteria for some predefined schematic rules (Code Files: PlantWithoutEquipment) | Import signposts (Code Files: ImportDynamapSignsFunction ImportMultiNetSignsFunction ImportNavStreetsSignsFunction SignpostUtilities) | Location-allocation solver (Code Files: frmLocationAllocationSolver) | Migrating from VB6 to VB .NET for ArcGIS 10 (Code Files: ButtonAddIn clscopy_table_sel clsCopyTableSelection) | Network Analyst Engine application (Code Files: frmLoadLocations) | Origin-destination cost matrix solver (Code Files: frmODCostMatrixSolver) | Retrieve a color ramp from the SymbologyControl (Code Files: SymbolForm) | Route application using the NAServer extension in ArcGIS Server via a GIS client (Code Files: Route_GISClientClass) | Route application using the NAServer extension in ArcGIS Server via a GIS server (Code Files: Route_GISServerAPIClass) | Server spatial query COM utility (Code Files: VegUtils_VBNet) | Server spatial query server object extension (Code Files: Extension) | Service area application using the NAServer extension in ArcGIS Server via a GIS server (Code Files: ServiceArea_GISServerAPIClass) | Service area solver (Code Files: frmServiceAreaSolver) | Vehicle routing problem solver (Code Files: frmVRPSolver) |

.NET Related Topics

Updating features | GeoData services | Geodatabase | GeoDatabaseUI | Geoprocessing services | How to create graph series with different color types | How to develop the SOE | How to geocode a table of addresses | How to load data into a network analysis problem | How to work with geoprocessing services | How to zoom to selected features in globe | Joining data | Limiting query results and output | Migrating VB6 to VB.NET for ArcGIS 10 | Querying geodatabase tables | Sorting tables |