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


IFieldsEdit.AddField Method (ArcObjects .NET 10.5 SDK)
ArcObjects Library Reference (GeoDatabase)  

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 Snippets

Create Table | Create FeatureClass

.NET Samples

Create a custom raster type (Code Files: ThumbnailBuilder) | Create a custom raster type from the ground up for DMCII data (Code Files: DMCIIRasterType) | Calculate area geoprocessing function tool (Code Files: CalculateAreaFunction)

.NET Related Topics

Building a custom geoprocessing function tool | Creating a plug-in data source | Creating class extensions | Creating feature classes | Creating fields | Creating indexes | Creating relationship classes | Creating tables | Geodatabase API best practices | How to geocode a table of addresses | How to standardize an address | Using the schema creator