Class FieldClass

Namespace
ESRI.ArcGIS.Geodatabase
Assembly
ESRI.Server.Geodatabase.dll
[Guid("F94F7534-9FDF-11D0-BEC7-00805F7C4268")]
[ClassInterface(ClassInterfaceType.None)]
public class FieldClass : Field, IFieldEdit, IField, IModelInfo, IClone, IGPValue, IXMLSerialize, IPersistStream, IPersist, IGPDescribe
Inheritance
FieldClass
Implements
Inherited Members

Constructors

FieldClass()

public FieldClass()

Explicit Interface Implementations

AliasName

The alias name of the field.

virtual string AliasName { get; }

Returns

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.

Assign(IClone)

Assigns the properties of src to the receiver.

virtual void Assign(IClone src)

Parameters

src IClone

CheckValue(object)

Indicates if the value is valid given the field definition.

virtual bool CheckValue(object Value)

Parameters

Value object

Returns

bool

Clone()

Clones the receiver and assigns the result to *clone.

virtual IClone Clone()

Returns

IClone

DataType

The data type of the value object.

virtual IGPDataType DataType { get; }

Returns

IGPDataType

Remarks

The DataType property returns the DataType object associated with this Value object.

DefaultValue

The default value of the field.

virtual object DefaultValue { get; }

Returns

object

Describe(string)

The description of the named object.

virtual object Describe(string Name)

Parameters

Name string

Returns

object

Deserialize(IXMLSerializeData)

Deserializes an object from XML.

virtual void Deserialize(IXMLSerializeData data)

Parameters

data IXMLSerializeData

Domain

The default domain of the field.

virtual IDomain Domain { get; }

Returns

IDomain

DomainFixed

Indicates if the field's domain is fixed.

virtual bool DomainFixed { get; }

Returns

bool

Editable

Indicates if the field is editable.

virtual bool Editable { get; }

Returns

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.

Empty()

Clears the value object.

virtual void Empty()

Remarks

The Empty method clears this Value object and releases any associated objects.

GeometryDef

The geometry definition for the field if IsGeometry is TRUE.

virtual IGeometryDef GeometryDef { get; }

Returns

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>

GetAsText()

Provides the value of the value object.

virtual string GetAsText()

Returns

string

Remarks

The GetAsText method returns this Value object as a text string. For DataElement value objects it is the NameString. For simple value objects it is the text string for the scalar value.

GetClassID(out Guid)

virtual void GetClassID(out Guid pClassID)

Parameters

pClassID Guid

GetSizeMax(out _ULARGE_INTEGER)

virtual void GetSizeMax(out _ULARGE_INTEGER pcbSize)

Parameters

pcbSize _ULARGE_INTEGER

IFieldEdit_AliasName

virtual string IFieldEdit_AliasName { get; }

Returns

string

Remarks

This is only supported on fields from object classes and feature classes that are registered with a personal, File or ArcSDE geodatabase. 

This is not supported for shapefiles, coverages, or other data sources.

You can register a table within the geodatabase to become an object class by right-clicking on the table in ArcCatalog and clicking on "Register with Geodatabase".

IFieldEdit_AliasName_2

The alias name of the field.

virtual string IFieldEdit_AliasName_2 { set; }

Returns

string

IFieldEdit_CheckValue(object)

virtual bool IFieldEdit_CheckValue(object Value)

Parameters

Value object

Returns

bool

IFieldEdit_DefaultValue

virtual object IFieldEdit_DefaultValue { get; }

Returns

object

IFieldEdit_DefaultValue_2

The default value of the field.

virtual object IFieldEdit_DefaultValue_2 { set; }

Returns

object

IFieldEdit_Domain

virtual IDomain IFieldEdit_Domain { get; }

Returns

IDomain

IFieldEdit_DomainFixed

virtual bool IFieldEdit_DomainFixed { get; }

Returns

bool

IFieldEdit_DomainFixed_2

Indicates if the field's domain cannot be modified.

virtual bool IFieldEdit_DomainFixed_2 { set; }

Returns

bool

IFieldEdit_Domain_2

The default domain of the field.

virtual IDomain IFieldEdit_Domain_2 { set; }

Returns

IDomain

IFieldEdit_Editable

virtual bool IFieldEdit_Editable { get; }

Returns

bool

IFieldEdit_Editable_2

Indicates if the field can be edited. This should always be set to true.

virtual bool IFieldEdit_Editable_2 { set; }

Returns

bool

IFieldEdit_GeometryDef

virtual IGeometryDef IFieldEdit_GeometryDef { get; }

Returns

IGeometryDef

IFieldEdit_GeometryDef_2

The geometry definition if IsGeometry is TRUE.

virtual IGeometryDef IFieldEdit_GeometryDef_2 { set; }

Returns

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>

IFieldEdit_IsNullable

virtual bool IFieldEdit_IsNullable { get; }

Returns

bool

IFieldEdit_IsNullable_2

Indicates if field values can be null.

virtual bool IFieldEdit_IsNullable_2 { set; }

Returns

bool

IFieldEdit_Length

virtual int IFieldEdit_Length { get; }

Returns

int

IFieldEdit_Length_2

The maximum length, in bytes, for field values.

virtual int IFieldEdit_Length_2 { set; }

Returns

int

IFieldEdit_Name

virtual string IFieldEdit_Name { get; }

Returns

string

IFieldEdit_Name_2

The name of the field.

virtual string IFieldEdit_Name_2 { set; }

Returns

string

IFieldEdit_Precision

virtual int IFieldEdit_Precision { get; }

Returns

int

Remarks

Precision is always returned as 0 from personal or File geodatabase fields.

IFieldEdit_Precision_2

The precision for field values.

virtual int IFieldEdit_Precision_2 { set; }

Returns

int

IFieldEdit_RasterDef

virtual IRasterDef IFieldEdit_RasterDef { get; }

Returns

IRasterDef

IFieldEdit_RasterDef_2

The raster column definition.

virtual IRasterDef IFieldEdit_RasterDef_2 { set; }

Returns

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>

IFieldEdit_Required

virtual bool IFieldEdit_Required { get; }

Returns

bool

IFieldEdit_Required_2

Indicates if the field is required.

virtual bool IFieldEdit_Required_2 { set; }

Returns

bool

IFieldEdit_Scale

virtual int IFieldEdit_Scale { get; }

Returns

int

Remarks

Precision is always returned as 0 from personal or File geodatabase fields.

IFieldEdit_Scale_2

The scale for field values.

virtual int IFieldEdit_Scale_2 { set; }

Returns

int

IFieldEdit_Type

virtual esriFieldType IFieldEdit_Type { get; }

Returns

esriFieldType

IFieldEdit_Type_2

The type for the field.

virtual esriFieldType IFieldEdit_Type_2 { set; }

Returns

esriFieldType

IFieldEdit_VarType

virtual int IFieldEdit_VarType { get; }

Returns

int

IPersistStream_GetClassID(out Guid)

virtual void IPersistStream_GetClassID(out Guid pClassID)

Parameters

pClassID Guid

IsDirty()

virtual void IsDirty()

IsEmpty()

Indicates if the value object is empty.

virtual bool IsEmpty()

Returns

bool

Remarks

The IsEmpty method returns if this Value object has been set or not.

IsEqual(IClone)

Indicates if the receiver and other have the same properties.

virtual bool IsEqual(IClone other)

Parameters

other IClone

Returns

bool

IsIdentical(IClone)

Indicates if the receiver and other are the same object.

virtual bool IsIdentical(IClone other)

Parameters

other IClone

Returns

bool

IsNullable

Indicates if the field can contain null values.

virtual bool IsNullable { get; }

Returns

bool

Length

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

virtual int Length { get; }

Returns

int

Load(IStream)

virtual void Load(IStream pstm)

Parameters

pstm IStream

ModelName

The model name of the field.

virtual string ModelName { get; set; }

Returns

string

Remarks

Returns the model name currently associated with the field or object class.

Name

The name of the field.

virtual string Name { get; }

Returns

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.

virtual int Precision { get; }

Returns

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.

virtual IRasterDef RasterDef { get; }

Returns

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.

virtual bool Required { get; }

Returns

bool

Save(IStream, int)

virtual void Save(IStream pstm, int fClearDirty)

Parameters

pstm IStream
fClearDirty int

Scale

The scale for field values.

virtual int Scale { get; }

Returns

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.

Serialize(IXMLSerializeData)

Serializes an object to XML.

virtual void Serialize(IXMLSerializeData data)

Parameters

data IXMLSerializeData

SetAsText(string)

Provides the value of the value object with the given string value.

virtual IGPMessage SetAsText(string text)

Parameters

text string

Returns

IGPMessage

Remarks

The SetAsText method sets the value of this Value object as a text string. For DataElement value objects it is the NameString. For simple value objects it is the text string representing the scalar value.

Type

The type of the field.

virtual esriFieldType Type { get; }

Returns

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).

virtual int VarType { get; }

Returns

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