IFields Interface

Provides access to members that return information about the fields.

Description

The Fields object represents a collection of columns in a table. The term _field_is synonymous with column. Each table in a database has an ordered collection of fields, there is always at least one field in a table. The ordered collection behaves like a list, so it is possible to access individual fields by a numbered position (or index) in the list.

Members

Name Description
Read-only property Field The field at the specified index in the fields collection.
Read-only property FieldCount The number of fields in the fields collection.
Method FindField Finds the index of the named field in the fields collection.
Method FindFieldByAliasName Finds the index of the field with the alias name in the fields collection.

IFields.Field Property

The field at the specified index in the fields collection.

Public Function get_Field ( _
    ByVal Index As Integer _
) As IField
public IField get_Field (
    int Index
);

IFields.FieldCount Property

The number of fields in the fields collection.

Public ReadOnly Property FieldCount As Integer
public int FieldCount {get;}

Remarks

FieldCountis a one-based index. Therefore if you want to use IFields::FieldCount to get a particular index and use IFields::Field to get the field at the particular index, you will need to convert FieldCountto a zero-based index.

IFields.FindField Method

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

Public Function FindField ( _
    ByVal Name As String _
) As Integer
public int FindField (
    string Name
);

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.

``

IFields.FindFieldByAliasName Method

Finds the index of the field with the alias name in the fields collection.

Public Function FindFieldByAliasName ( _
    ByVal Name As String _
) As Integer
public int FindFieldByAliasName (
    string Name
);

Errors Returned

If no field is found, this method returns -1.

Classes that implement IFields

Classes Description
Fields Esri Fields object.

Remarks

The IFieldsinterface provides information about a Fieldscollection and also provides access to individual fields. When using IFields::FindField, remember that there are equivalent methods on IClassand ICursor�they are shortcuts which save you having to get the Fieldscollection.

When programming with ArcMap, there is a distinction between IFieldsand two other interfaces, ILayerFieldsand ITableFields. ILayerFieldsis particular to an ArcMap layer, so for example, an alias name belongs to the field as defined in that layer rather than being stored with the underlying table.

Your browser is no longer supported. Please upgrade your browser for the best experience. See our browser deprecation post for more details.