Interface IField

Namespace
ESRI.ArcGIS.Geodatabase
Assembly
ESRI.Server.Geodatabase.dll

Provides access to members that return information about the field.

[Guid("FCB01CB3-9F0B-11D0-BEC7-00805F7C4268")]
[InterfaceType(ComInterfaceType.InterfaceIsIUnknown)]
public interface IField

Remarks

When you create a field of type esriFieldTypeSingle, esriFieldTypeDouble or esriFieldTypeInteger, and specify zero for precision and scale, the geodatabase will attempt to create a binary type field if the underlying database supports it. Personal geodatabases support only binary type fields.  ArcGIS ignores precision and scale of binary type fields.

The length property of a field has meaning only for esriFieldTypeString fields. The length property for all other field types is not important and will be ignored if specified.

Properties

AliasName

The alias name of the field.

string AliasName { get; }

Property Value

string

Remarks

This is only supported on fields from object classes and feature classes that are registered with the geodatabase; Personal, File or ArcSDE geodatabases.  For fields coming from other data sources (shapefiles, coverages, etc) the AliasName will be the same string as the field name.

DefaultValue

The default value of the field.

object DefaultValue { get; }

Property Value

object

Domain

The default domain of the field.

IDomain Domain { get; }

Property Value

IDomain

DomainFixed

Indicates if the field's domain is fixed.

bool DomainFixed { get; }

Property Value

bool

Editable

Indicates if the field is editable.

bool Editable { get; }

Property Value

bool

Remarks

The Editable property of a field should always be set to TRUE.  Setting it to FALSE will prevent all users from editing the contents of the field.  To set a field to be read-only, use the IFieldInfo3.ReadOnly property.

It is best to loop through the fields of a feature and skip the fields that are not editable, rather than allowing users to attempt to edit fields that cannot be edited.

GeometryDef

The geometry definition for the field if IsGeometry is TRUE.

IGeometryDef GeometryDef { get; }

Property Value

IGeometryDef

Remarks

<P>The <STRONG>GeometryDef</STRONG> object defines the spatial qualities of a feature class. The most fundmental spatial quality is the Geometry type, for example, point, line, and polygon. Other information necessary to define the feature class includes the spatial referencing system, whether the vertices have height or measure data, and, for geodatabases, the spatial index parameters.</P> <P>The <STRONG>GeometryDef </STRONG>can be accessed from a shape field, that is a field of type <STRONG>esriFieldTypeGeometry</STRONG>. The actual geometry type is defined by the <STRONG>esriGeometryType </STRONG>enumeration, though currently only four values are acceptable with respect to <STRONG>GeometryDef </STRONG>objects: <STRONG>esriGeometryPoint</STRONG>, <STRONG>esriGeometryMultipoint</STRONG>, <STRONG>esriGeometryPolyline</STRONG>, and <STRONG>esriGeometryPolygon</STRONG>.</P> <P>Beware of the confusion between the <STRONG>esriGeometryType</STRONG> enumeration and the similarly named <STRONG>esriFeatureType</STRONG> and <STRONG>esriShapeType</STRONG>. The following table shows the different roles of those enumerations.</P> <DIV class=tablediv> <TABLE class=dtTABLE cellSpacing=0> <TBODY> <TR vAlign=top> <TH class=t width="33%">ArcObjects Enumeration</TH> <TH class=t width="33%">Values</TH> <TH class=t width="33%">Interfaces that use the enumeration</TH></TR> <TR vAlign=top> <TD width="33%"><STRONG>esriGeometryType</STRONG><BR><BR>Type of geometry in a geodatabase. Those in bold are valid for feature classes, others are component geometry objects.</TD> <TD class=t width="33%"><STRONG>esriGeometryPoint<BR>esriGeometryMultipoint<BR>esriGeometryPolygon<BR>esriGeometryPolyline<BR>esriGeometryLine</STRONG><BR>esriGeometryCircularArc<BR>esriGeometryEllipticArc<BR>esriGeometryBezier3Curve<BR>esriGeometryPath<BR>esriGeometryNull<BR>esriGeometryRing<BR>esriGeometryEnvelope<BR>esriGeometryAny<BR>esriGeometryBag<BR>esriGeometryMultiPatch<BR>esriGeometryTriangleStrip<BR>esriGeometryTriangleFan<BR>esriGeometryRay<BR>esriGeometrySphere<BR>esriGeometryTriangles<BR></TD> <TD width="33%">IFeatureClass::ShapeType<BR>IGeometry::GeometryType<BR>IGeometryDef::GeometryType<BR><BR>also<BR>IGeometryDefEdit,<BR>IGeometryFactory,<BR>IEditSketchExtension,<BR>IGridConversionOp,<BR>IDimensionConstructor</TD></TR> <TR vAlign=top> <TD width="33%"><STRONG>esriFeatureType</STRONG><BR><BR>Feature types defined by<BR>feature class extensions</TD> <TD class=t width="33%">esriFTSimple<BR>esriFTSimpleJunction<BR>esriFTSimpleEdge<BR>esriFTComplexJunction<BR>esriFTComplexEdge<BR>esriFTAnnotation<BR>esriFTCoverageAnnotation<BR>esriFTDimension<BR>esriFTRasterCatalogItem<BR></TD> <TD width="33%">IFeature::FeatureType<BR>IFeatureClass::FeatureType<BR>IFeatureClassDescription::FeatureType<BR>IFeatureWorkspace::CreateFeatureClass<BR>IFeatureDataset::CreateFeatureClass<BR><BR>also, IGeometricNetwork and<BR>INetworkLoader</TD></TR> <TR vAlign=top> <TD width="33%"><STRONG>esriShapeType</STRONG><BR><BR>Type of geometry in a<BR>shapefile</TD> <TD class=t width="33%">See the help for esriShapeType<BR>for a full list </TD> <TD width="33%">IFeature::FeatureType<BR>IFeatureClass::FeatureType<BR>IFeatureClassDescription::FeatureType<BR>IFeatureWorkspace::CreateFeatureClass<BR>IFeatureDataset::CreateFeatureClass<BR><BR>also, IGeometricNetwork and<BR>INetworkLoader</TD></TR></TBODY></TABLE></DIV>

IsNullable

Indicates if the field can contain null values.

bool IsNullable { get; }

Property Value

bool

Length

The maximum length, in bytes, for values described by the field.

int Length { get; }

Property Value

int

Name

The name of the field.

string Name { get; }

Property Value

string

Remarks

Geodatabase feature classes, depending on their geometry type, may contain automatically generated fields for shape length and area. In personal and file geodatabases, these fields will be named using the name of the shape field suffixed with "_Length" and "_Area". In an SDE geodatabase, the names of these fields will be dependant on the underlying DBMS.

The IFeatureClass::ShapeFieldName property should be used to determine the name of the length and area fields for a feature class.

Precision

The precision for field values.

int Precision { get; }

Property Value

int

Remarks

Precision is the number of digits in a number. For example, the number 56.78 has a precision of 4. Precision is only valid for fields that are numeric. Precision is always returned as 0 from personal or File geodatabase fields.

RasterDef

The raster column definition.

IRasterDef RasterDef { get; }

Property Value

IRasterDef

Remarks

<P>The <STRONG>RasterDef</STRONG> object specifies the property of a raster column, such as description of the column, spatial reference, and for Personal and File geodatabases, whether the Raster field is managed by the geodatabase.</P>

Required

Indicates if the field is required.

bool Required { get; }

Property Value

bool

Scale

The scale for field values.

int Scale { get; }

Property Value

int

Remarks

Scale is the number of digits to the right of the decimal point in a number. For example, the number 56.78 has a scale of 2. Scale applies only to fields that are double.  Scale is always returned as 0 from personal or File geodatabase fields.

Type

The type of the field.

esriFieldType Type { get; }

Property Value

esriFieldType

Remarks

For more information on the relation between esriFieldType values and the underlying SDE and DBMS data types, see the following articles in the ArcGIS Help:

  • "A comparison of ArcGIS, ArcSDE, and DB2 data types"
  • "A comparison of ArcGIS, ArcSDE, and Informix data types"
  • "A comparison of ArcGIS, ArcSDE, and PostgreSQL data types"
  • "A comparison of ArcGIS, ArcSDE, and Oracle data types"
  • "A comparison of ArcGIS, ArcSDE, and SQL Server data types"

 

The following table outlines the equivalent field data types in ArcCatalog, ArcObjects and .NET:

ArcCatalog

esriFieldType

(IField::Type)

.NET Variable Type

Short Integer esriFieldTypeSmallInteger System.Int16
Long Integer esriFieldTypeInteger System.Int32
Float esriFieldTypeSingle System.Single
Double esriFieldTypeDouble System.Double
Text esriFieldTypeString System.String
Date esriFieldTypeDate System.DateTime
Object ID esriFieldTypeOID System.Int32
Geometry esriFieldTypeGeometry ESRI.ArcGIS.Geometry.IGeometry
Blob esriFieldTypeBlob ESRI.ArcGIS.esriSystem.IMemoryBlobStream
Raster esriFieldTypeRaster ESRI.ArcGIS.Geodatabase.IRasterValue
GUID esriFieldTypeGUID System.String
GlobalID esriFieldTypeGlobalID System.String

The following table outlines the Coverage, INFO Item to Geodatabase field mapping:

Item type Item width Geodatabase field type (esriFieldType)
B 4 esriFieldTypeInteger
C 1-320 esriFieldTypeString
D 8 esriFieldTypeDate
F 4 esriFieldTypeSingle
F 8 esriFieldTypeDouble
I 1-4 esriFieldTypeSmallInteger
I 5-9 esriFieldTypeInteger
I 10-16 esriFieldTypeDouble
N 1-9 esriFieldTypeSingle
N 10-16 esriFieldTypeDouble

The following table outlines the Shapefile, dBASE field to Geodatabase field mapping:

Field type Field width Geodatabase field type (esriFieldType)
Date - esriFieldTypeDate
String 1-255 esriFieldTypeString
Boolean - esriFieldTypeString
Number 1-16 (decimals = 0) esriFieldTypeInteger
Number 1-16 (decimals > 0) esriFieldTypeDouble
Note: Shapefiles only support date fields. Time is not supported. Geodatabases support date\time fields. If a shapefiles date field is queried for the time a default value of "12:00:00 AM" will be returned.

VarType

The VARTYPE of the field (e.g. VT_I4).

int VarType { get; }

Property Value

int

Remarks

The following is a list of the VARTYPE constants that can be returned from this property.
Field type VarType

esriFieldTypeSmallInteger

esriFieldTypeInteger

esriFieldTypeSingle

esriFieldTypeDouble

esriFieldTypeString

esriFieldTypeDate

esriFieldTypeOID

esriFieldTypeGeometry

esriFieldTypeBlob

esriFieldTypeRaster

esriFieldTypeGUID

esriFieldTypeGlobalID

2

3

4

5

8

7

3

13

13

13

8

8


Methods

CheckValue(object)

Indicates if the value is valid given the field definition.

bool CheckValue(object Value)

Parameters

Value object

Returns

bool