ArcObjects Library Reference (GeoDatabase)  

IClassSchemaEdit.RegisterAsObjectClass Method

Registers this class with the database, assigning it a class id and creating an object id column.

[Visual Basic .NET]
Public Function RegisterAsObjectClass ( _
    ByVal suggestedOIDFieldName As String, _
    ByVal ConfigKeyword As String _
) As Integer
[C#]
public int RegisterAsObjectClass (
    string suggestedOIDFieldName,
    string ConfigKeyword
);
[C++]
HRESULT RegisterAsObjectClass(
  BSTR suggestedOIDFieldName,
  BSTR ConfigKeyword,
  long* ObjectClassID
);
[C++]

Parameters

suggestedOIDFieldName [in]   suggestedOIDFieldName is a parameter of type BSTR ConfigKeyword [in]   ConfigKeyword is a parameter of type BSTR ObjectClassID [out, retval]   ObjectClassID is a parameter of type long

Product Availability

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

Description

The RegisterAsObjectClass method will register a table or feature class (ArcSDE layer) in the database with the Geodatabase. The act of registering the data as an object class will create records for the object class in the Geodatabase system tables and assign the object class a unique ID. Once a table or SDE layer is registered as an object class, it can participate in rules, topological relationships and relationships.

When registering a table or ArcSDE layer as an object class, an ObjectID field must be added to it. This field will contain the object IDs which uniquely identify each feature in the class. The object IDs for existing data will automatically be generated. Once a table or ArcSDE layer has been registered as an object class in the Geodatabase, it cannot be unregistered.

RegisterAsObjectClass takes two arguments: the name of the object ID field, and the ArcSDE configuration keyword to use for storage of the new data that is inserted into the object ID field. RegisterAsObjectClass returns a long which is the object class ID assigned to the newly registered class.

See Also

IClassSchemaEdit Interface | IObjectClass Interface