C# IWorkspaceFactory wsFact = new FileGDBWorkspaceFactoryClass(); IWorkspace ws = wsFact.OpenFromFile(database, 0); IEnumDataset enumDS = ws.get_Datasets(esriDatasetType.esriDTFeatureDataset); IFeatureDataset ds = (IFeatureDataset)enumDS.Next(); IEnumDataset enumFC = ds.Subsets; IDataset currFC = enumFC.Next(); FeatureClass fc = (FeatureClass)currFC;
Solved! Go to Solution.
If you're trying to open a specific feature class then call the IFeatureWorkspace.OpenFeatureClass method.
For the stand-alone feature classes, pass in esriDTFeatureClass. This will return an enumeration of feature class objects that you will need to loop through.