This document is archived and information here might be outdated. Recommended version. |
ArcObjects Help for .NET developers > ArcObjects namespaces > Geodatabase > ESRI.ArcGIS.GeoDatabase > Interfaces > IF > IFeatureCursor Interface > IFeatureCursor.InsertFeature Method (ArcObjects .NET 10.5 SDK) |
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
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.
This method should only be called on insert cursors.