This document is archived and information here might be outdated. Recommended version. |
Get the feature with the specified object ID.
[Visual Basic .NET] Public Function GetFeature ( _ ByVal ID As Integer _ ) As IFeature
[C#] public IFeature GetFeature ( int ID );
[C++]
HRESULT GetFeature(
long ID
);
[C++]
Parameters ID [in]
ID is a parameter of type long
An error with the code FDO_E_FEATURE_NOT_FOUND will be raised if an invalid Object ID is specified.
GetFeature will return a feature from the feature class with the parameter-specified Object ID (OID). This method is typically used to find a particular feature with a known Object ID. A cursor should be used to iterate through all features in a feature class.
Calling the GetFeature method on a feature class (via the IFeatureClass interface on the feature class) has the same effect as calling the GetRow method on the feature class (via the ITable interface) except that the return value is an IFeature reference, rather than IRow.
IFeatureClass Interface | IObject Interface | IFeature Interface | IFeatureCursor Interface