IClass.FindField Method (ArcObjects .NET 10.6 SDK)
ArcObjects Library Reference (GeoDatabase)  

IClass.FindField Method

The index of the field with the specified name.

[Visual Basic .NET]
Public Function FindField ( _
    ByVal Name As String _
) As Integer
[C#]
public int FindField (
    string Name
);
[C++]
HRESULT FindField(
  BSTR Name
);
[C++]

Parameters Name [in]
Name is a parameter of type BSTR

Product Availability

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

Remarks

If FindField returns -1, the Field could not be found in the Fields collection.

Developers working with SDE should be aware of qualified field names and their impact on calls to FindField. For more information, see the IFields2 interface.

See Also

IClass Interface

.NET Samples

Closest facility solver (Code Files: frmClosestFacilitySolver) | Service area solver (Code Files: frmServiceAreaSolver) | Location-allocation solver (Code Files: frmLocationAllocationSolver) | Utility wizard for basic schematic datasets configuration (Code Files: GenerateSchematicTemplate) | Vehicle routing problem solver (Code Files: frmVRPSolver) | Origin-destination cost matrix solver (Code Files: frmODCostMatrixSolver) | Extending the replication synchronization process (Code Files: RasterSyncWorkspaceExtension) | Calculate area geoprocessing function tool (Code Files: CalculateAreaFunction) | RSS weather GraphicTracker (Code Files: RSSWeather) | RSS weather layer (Code Files: RSSWeatherLayerClass) | Timestamper class extension (Code Files: TimestampClassExtension) | Retrieve a color ramp from the SymbologyControl (Code Files: SymbolForm) | Play back tracking data (Code Files: PlaybackDataButton) | Reducing schematic nodes and computing a cumulative attribute via a schematic rule (Code Files: FrmNodeReductionRule)

.NET Related Topics

Assigning domains to fields | Converting simple data | Creating an address locator | Creating class extensions | Creating features | Creating indexes | Geodatabase API best practices | How to create graph series with different color types | How to load data into a network analysis problem | Listening to object class events | Updating attributes of existing features | Updating geometry of existing features | Using schema locks | Working with fields | Working with indexes