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


IClassSchemaEdit.AlterDomain Method (ArcObjects .NET 10.8 SDK)
ArcObjects Help for .NET developers > ArcObjects Help for .NET developers > ArcObjects namespaces > Geodatabase > ESRI.ArcGIS.GeoDatabase > Interfaces > IC > IClassSchemaEdit Interface > IClassSchemaEdit.AlterDomain Method
ArcGIS Developer Help

IClassSchemaEdit.AlterDomain Method

The default domain of the object class field.

[Visual Basic .NET]
Public Sub AlterDomain ( _
    ByVal FieldName As String, _
    ByVal Domain As IDomain _
)
[C#]
public void AlterDomain (
    string FieldName,
    IDomain Domain
);
[C++]
HRESULT AlterDomain(
  BSTR FieldName,
  IDomain* Domain
);
[C++]
Parameters
FieldName [in]

FieldName is a parameter of type BSTR Domain [in]
Domain is a parameter of type IDomain*

Product Availability

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

Remarks

Domains are used in the Geodatabase to validate the contents of fields in an object class. For example, you can use a domain to specify a valid range of values, or a valid set of values for a particular field in an object class. You can assign domains to a field in an object class at either the class level, or the subtype level. The AlterDomain method on IClassSchemaEdit allows you to set a domain for a field at the class level.

AlterDomain takes as arguments the name of the field you want to associate a domain with as a string, and the domain you are associating as an IDomain. You can get an enumeration of domains in a workspace by calling the Domains or DomainsByFieldType methods on the IWorkspaceDomains interface.

Once a domain is associated with a field in your object class, the values in that field will be validated against that domain when a row in the object class is validated with the IValidate interface, or the Validate Selection command in the Editor.

See Also

IClassSchemaEdit Interface | IField Interface | IDomain Interface | IWorkspaceDomains Interface | IValidation Interface