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


IFeatureCursor.InsertFeature Method (ArcObjects .NET 10.5 SDK)
ArcObjects Library Reference (GeoDatabase)  

IFeatureCursor.InsertFeature Method

Insert a new Feature into the database using the property values in the input buffer. The ID of the new Feature is returned.

[Visual Basic .NET]
Public Function InsertFeature ( _
    ByVal buffer As IFeatureBuffer _
) As Object
[C#]
public object InsertFeature (
    IFeatureBuffer buffer
);
[C++]
HRESULT InsertFeature(
  IFeatureBuffer* buffer,
  VARIANT* ID
);
[C++]

Parameters buffer [in]
buffer is a parameter of type IFeatureBuffer ID [out, retval] ID is a parameter of type VARIANT

Product Availability

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

Errors Returned

FDO_E_INVALID_GRID_SIZE: This error can occur if the grid size of the feature class is too small to handle the feature being inserted. To avoid this error, put the feature class into load-only mode (see IFeatureClassLoad) prior to creating the insert cursor and when the inserts are completed take the feature class out of load-only mode. The geodatabase will recalculate an appropriate grid size when load-only mode is turned off.

Remarks

This method should only be called on insert cursors.

See Also

IFeatureCursor Interface

.NET Samples

Extending the replication synchronization process (Code Files: RasterSyncWorkspaceExtension)

.NET Related Topics

Creating features | Geodatabase API best practices