IClass Interface

Provides access to members that return information about and manage the class.

Members

Name Description
Method AddField Adds a field to this object class.
Method AddIndex Adds an index to this object class.
Read-only property CLSID The GUID for the COM Class (CoClass) corresponding to instances of this object class.
Method DeleteField Deletes a field from this object class.
Method DeleteIndex Deletes an index from this object class.
Read-only property EXTCLSID The GUID for the COM Class (CoClass) corresponding to the class extension for this object class.
Read-only property Extension The extension for this object class.
Read-only property ExtensionProperties The extension properties for this object class.
Read-only property Fields The fields collection for this object class.
Method FindField The index of the field with the specified name.
Read-only property HasOID Indicates if the class has an object identity (OID) field.
Read-only property Indexes The indexes collection for this object class.
Read-only property OIDFieldName The name of the field corresponding to the OID.

IClass.AddField Method

Adds a field to this object class.

Public Sub AddField ( _
    ByVal Field As IField _
)
public void AddField (
    IField Field
);

Errors Returned

FDO_E_TABLE_DUPLICATE_COLUMN:

  • A field with the specified name already exists in the table.

FDO_E_NO_SCHEMA_LICENSE:

  • You are not licensed to modify the schema of the feature class. This error can arise with an ArcGIS for Desktop Basic license when a field is added to a feature class that participates in a geometric network, topology, or composite relationship class (such as feature-linked annotation).

Functional License Check

If your application/site is not appropriately licensed, AddField can return an error of FDO_E_NO_SCHEMA_LICENSE.

Remarks

Prior to adding a new field to a class, an exclusive schema lock should be obtained using the ISchemaLock interface.

Attempting to add a new field that does not allow null values will fail, if the class already has data in it. The only solution is to recreate the class with the non-nullable field, then copy the rows from the original class into the new class.

IClass.AddIndex Method

Adds an index to this object class.

Public Sub AddIndex ( _
    ByVal Index As IIndex _
)
public void AddIndex (
    IIndex Index
);

Remarks

Prior to adding a new index to a class, an exclusive schema lock should be obtained using the ISchemaLock interface.

IClass.CLSID Property

The GUID for the COM Class (CoClass) corresponding to instances of this object class.

Public ReadOnly Property CLSID As UID
public UID CLSID {get;}

IClass.DeleteField Method

Deletes a field from this object class.

Public Sub DeleteField ( _
    ByVal Field As IField _
)
public void DeleteField (
    IField Field
);

Errors Returned

FDO_E_FIELD_CANNOT_DELETE_WEIGHT_FIELD:

  • Cannot delete a field that corresponds to an existing weight in a geometric network.

FDO_E_FIELD_CANNOT_DELETE_REQUIRED_FIELD:

  • Cannot delete a required field. For a list of required fields, see the Remarks section. If the field was set as required by the user, (check the IField::Required property and is not one of the fields listed under remarks), the IFieldEdit::Required property can be used to remove the required status, then the field can be deleted.

FDO_E_NO_SCHEMA_LICENSE:

  • You are not licensed to modify the schema of the feature class. This error can arise with an ArcGIS for Desktop Basic license when a field is added to a feature class that participates in a geometric network, topology, or composite relationship class (such as feature-linked annotation).

FDO_E_SE_DBMS_DOES_NOT_SUPPORT:

  • Cannot delete a field from DB2.

Remarks

DeleteField removes the specified field from a table, object class or feature class. Fields that are required by the Geodatabase and cannot be removed include:

  • OBJECTID field
  • SHAPE and shape dependent fields such as SHAPE_Length
  • Enabled, AncillaryRole and Weight field for network feature classes
  • Subtype fields. In order to delete a subtype field, it must first be removed as the subtype field, see the help on ISubtypes::SubtypeFieldName

Prior to deleting a field from a class, an exclusive schema lock should be obtained using the ISchemaLock interface.

IClass.DeleteIndex Method

Deletes an index from this object class.

Public Sub DeleteIndex ( _
    ByVal Index As IIndex _
)
public void DeleteIndex (
    IIndex Index
);

Remarks

Prior to deleting an index from a class, an exclusive schema lock should be obtained using the ISchemaLock interface.

IClass.EXTCLSID Property

The GUID for the COM Class (CoClass) corresponding to the class extension for this object class.

Public ReadOnly Property EXTCLSID As UID
public UID EXTCLSID {get;}

IClass.Extension Property

The extension for this object class.

Public ReadOnly Property Extension As Object
public object Extension {get;}

IClass.ExtensionProperties Property

The extension properties for this object class.

Public ReadOnly Property ExtensionProperties As IPropertySet
public IPropertySet ExtensionProperties {get;}

IClass.Fields Property

The fields collection for this object class.

Public ReadOnly Property Fields As IFields
public IFields Fields {get;}

IClass.FindField Method

The index of the field with the specified name.

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.

IClass.HasOID Property

Indicates if the class has an object identity (OID) field.

Public ReadOnly Property HasOID As Boolean
public bool HasOID {get;}

IClass.Indexes Property

The indexes collection for this object class.

Public ReadOnly Property Indexes As IIndexes
public IIndexes Indexes {get;}

IClass.OIDFieldName Property

The name of the field corresponding to the OID.

Public ReadOnly Property OIDFieldName As String
public string OIDFieldName {get;}

Classes that implement IClass

Classes Description
AttributedRelationshipClass Esri Attributed Relationship Class object.
FeatureClass Esri Feature Class object.
ObjectClass Esri Object Class object.
RasterCatalog A collection of raster datasets in a Geodatabase table.
RelQueryTable An object that joins two datasets based on common data values.
Table Esri Table object.
XYEventSource XY event source object.

Remarks

All tables support the IClassinterface.

The CLSIDproperty returns the globally unique identifier for the software component (COM coclass) representing the row objects stored and handed out by this table. Examples of the value of this property include the CLSIDs representing esriGeoDatabase.Row, esriGeoDatabase.Object, esriGeoDatabase.Feature, and esriGeoDatabase.AttributedRelationship.

The EXTCLSIDproperty returns the globally unique identifier for the software component (COM coclass) representing the class extension associated with this Table. Class extensions are a mechanism whereby a developer can associate additional class level methods with an ObjectClass in the database.

The CLSIDand EXTCLSIDand other similar properties for a Table are stored in the geodatabase as part of the data dictionary information for the database. These properties link the behavior of the class (as implemented by software components in a DLL) with the data in the table.

The Extensionproperty returns an interface on the ClassExtension associated with this Table.

The HasOIDproperty may be used to test if this table has an Object ID column. Tables representing object classes and attributed relationship classes in a geodatabase will have an Object ID column whose values are unique and are assigned by the geodatabase as new objects and attributed relationships are created. The �Register With Geodatabase� command available on the context menu of a table in ArcCatalog can be used to register a pre-existing table in an RDBMS as an object class, this process will add an Object ID column to the table if needed.

The IClassinterface also contains methods (inherited by ITable) to manage the collection of fields and indexes for a Table.

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