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


ICodedValueDomain.AddCode Method (ArcObjects .NET 10.4 SDK)
ArcObjects Library Reference (GeoDatabase)  

ICodedValueDomain.AddCode Method

Adds a (value, name) code.

[Visual Basic .NET]
Public Sub AddCode ( _
    ByVal Value As Object, _
    ByVal Name As String _
)
[C#]
public void AddCode (
    object Value,
    string Name
);
[C++]
HRESULT AddCode(
  VARIANT Value,
  BSTR Name
);
[C++]

Parameters Value [in] Value is a parameter of type VARIANT Name [in] Name is a parameter of type BSTR

Product Availability

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

Description

The AddCode method adds a code to the domain.

Remarks

The AddCode  method adds a new coded value to the coded value domain. AddCode requires a value for the coded value as a Variant, and the name of the coded value, which is a user friendly description for that coded value, as a String. The value supplied for the variant parameter must be of the correct type for the domain (e.g., Numeric values for a numeric domain, string values for a string domain).
If AddCode is called on a domain that is already created, the IWorkspaceDomains2::AlterDomain method must be called to persist the change.

See Also

ICodedValueDomain Interface

.NET Related Topics

Creating and modifying domains