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


IFieldsEdit.AddField Method (ArcObjects .NET 10.8 SDK)
ArcObjects Help for .NET developers > ArcObjects Help for .NET developers > ArcObjects namespaces > Geodatabase > ESRI.ArcGIS.GeoDatabase > Interfaces > IF > IFieldsEdit Interface > IFieldsEdit.AddField Method
ArcGIS Developer Help

IFieldsEdit.AddField Method

Add a field to the fields collection.

[Visual Basic .NET]
Public Sub AddField ( _
    ByVal Field As IField _
)
[C#]
public void AddField (
    IField Field
);
[C++]
HRESULT AddField(
  IField* Field
);
[C++]
Parameters
Field [in]

Field is a parameter of type IField*

Product Availability

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

Remarks

AddField is used when creating a fields collection and cannot be used to insert a field into a fields collection belonging to an existing table. To add a field to an existing object class, use the IClass::AddField method.

The order in which fields are added to the fields collection will dictate their order in the database.

See Also

IFieldsEdit Interface

.NET Samples

Create a custom raster type Create a custom raster type from the ground up for DMCII data Calculate area geoprocessing function tool