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


IFields.FindField Method (ArcObjects .NET 10.4 SDK)
ArcObjects Library Reference (GeoDatabase)  

IFields.FindField Method

Finds the index of the named field in the fields collection.

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

Parameters Name [in] Name is a parameter of type BSTR Index [out, retval] Index is a parameter of type long

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

IFields Interface

.NET Samples

Convert part to feature command (Code Files: ConvertPart) | Curve conversion add-in (Code Files: CurveConversionDockWin) | ArcGIS Network Analyst extension Engine application (Code Files: frmMain) | Reducing schematic nodes and computing a cumulative attribute via a schematic rule (Code Files: NodeReductionRule)

.NET Related Topics

Copying or loading data while preserving GlobalID values | Creating a plug-in data source | Creating annotation and dimension feature classes | Creating feature classes | Creating fields | Defining a renderer for a layer | How to standardize an address