Where is the feature class in use? If it's in your map document then you probably need to disconnect the layer from its data source (IDataLayer2.Disconnect) and delete it from the map.
Use IDataset.Delete. I would imagine you can't delete feature datasets unless they are empty though.
IDataset pdataset; pdataset = (ESRI.ArcGIS.Geodatabase.IDataset)featureClass; if (pdataset.CanDelete() && pdataset != null) pdataset.Delete(); // Throw exception
Signed in members can post, follow updates, and more. New here? Register a free account.
Find useful guides, FAQs, and documents to help you navigate and make the most of Esri Community.