ArcObjects Component Help  (Core)    

IClassSchemaEdit.AlterDomain Method

The default domain of the object class field.

[Visual Basic 6.0]
Sub AlterDomain(
    ByVal FieldName As String, _
    ByVal Domain As IDomain _
) As Empty
[Visual Basic .NET]
Public Sub AlterDomain (
    ByVal FieldName As String, _
    ByVal Domain As IDomain _
)
[C#]
public void AlterDomain (
    string FieldName,
    IDomain Domain
);
[C++]
public: void AlterDomain (
    String* FieldName,
    IDomain Domain
);

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

IField Interface