Deletes a field from this object class.
[Visual Basic 6.0] Sub DeleteField(
ByVal Field As IField _
)
[Visual Basic .NET] Public Sub DeleteField ( _ ByVal Field As IField _ )
[C#] public void DeleteField ( IField Field );
[Java] public void deleteField ( IField Field ) throws IOException, AutomationException
[C++] HRESULT DeleteField( IField* Field );
-2147219878 - FDO_E_FIELD_CANNOT_DELETE_WEIGHT_FIELD
Cannot delete a field that corresponds to an existing weight in a geometric network.
-2147219877 - FDO_E_FIELD_CANNOT_DELETE_REQUIRED_FIELD
Cannot delete a required field. For a list of required fields, see the remarks section.
DeleteField removes the specified field from a table, object class or feature class. Fields that are required by the Geodatabase and cannot be removed include:
The following sample code demonstrates one methodology for deleting a field using DeleteField
'Assume we have a reference to a feature class, pFC
Dim pFields As IFields
Dim pField As IField
Set pFields = pFC.Fields
Set pField = pFields.Field(pFields.FindField("MyField"))
pFC.DeleteField pField