ArcObjects Library Reference (GeoDatabase)  

IClassSchemaEdit.AlterDefaultValue Method

The default value of the object class field.

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

Parameters

FieldName [in]   FieldName is a parameter of type BSTR Value [in]   Value is a parameter of type VARIANT

Product Availability

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

Remarks

You can assign a default value to a field in an object class at either the class level, or the subtype level. The AlterDefaultValue method on IClassSchemaEdit allows you to set a default value for a field at the class level.

AlterDefaultValue takes as arguments the name of the field you want to associate a default value with as a string, and the default value you are associating as a variant. AlterDefaultValue will fail if the default value cannot be stored in the field.

Once a default value is associated with a field in your object class, you can use the InitDefaultValues method on IRowSubtypes to populate the fields in a object in your object class with its default value. This method is most often called after you have created a new feature or object in the object class, and before storing it.

See Also

IClassSchemaEdit Interface | IField Interface