Delete Method (SchemaBuilder)
Enqueue the delete operation on the object with the name referred to by the
Description.
Deleting a Table
// Create a TableDescription object
TableDescription tableDescription = new TableDescription(table.GetDefinition());
// Create a SchemaBuilder object
SchemaBuilder schemaBuilder = new SchemaBuilder(geodatabase);
// Add the deletion of the table to our list of DDL tasks
schemaBuilder.Delete(tableDescription);
// Execute the DDL
bool success = schemaBuilder.Build();
Deleting a Feature Class
// Create a FeatureClassDescription object
FeatureClassDescription featureClassDescription = new FeatureClassDescription(featureClass.GetDefinition());
// Create a SchemaBuilder object
SchemaBuilder schemaBuilder = new SchemaBuilder(geodatabase);
// Add the deletion fo the feature class to our list of DDL tasks
schemaBuilder.Delete(featureClassDescription);
// Execute the DDL
bool success = schemaBuilder.Build();
Deleting a FeatureDataset
// Deleting a FeatureDataset named as 'Parcel_Information'
FeatureDatasetDefinition featureDatasetDefinition = geodatabase.GetDefinition<FeatureDatasetDefinition>("Parcel_Information");
FeatureDatasetDescription featureDatasetDescription =
new FeatureDatasetDescription(featureDatasetDefinition);
SchemaBuilder schemaBuilder = new SchemaBuilder(geodatabase);
// Delete an existing feature dataset named as 'Parcel_Information'
schemaBuilder.Delete(featureDatasetDescription);
schemaBuilder.Build();
Target Platforms: Windows 11, Windows 10, Windows 8.1
ArcGIS Pro version: 2.8 or higher.