ArcObjects Library Reference (GeoDatabase)  

IWorkspaceDomains.DeleteDomain Method

Deletes the given domain from the workspace.

[Visual Basic .NET]
Public Sub DeleteDomain ( _
    ByVal DomainName As String _
)
[C#]
public void DeleteDomain (
    string DomainName
);
[C++]
HRESULT DeleteDomain(
  BSTR DomainName
);
[C++]

Parameters

DomainName [in]   DomainName is a parameter of type BSTR

Product Availability

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

Errors Returned

FDO_E_DOMAIN_USED_AS_DEFAULT_DOMAIN: The domain is associated with a field as the default domain. Remove the association with the IClassSchemaEdit::AlterDomain method.

Remarks

This method will delete a domain from the workspace. For DeleteDomain to execute successfully, you must be connected to the workspace as the user who created the domain you are deleting, and the domain must not be in use by any object classes in the database. Use the CanDeleteDomain property to determine if a domain can be deleted. To unassociate a domain with a field, use the IClassSchemaEdit::AlterDomain method.

See Also

IWorkspaceDomains Interface