Just open the workspace by using the path to the geodatabase and then enumerate through the containing datasets.The code below iterates through all feature datasets and their containing feature classes. If your feature classes are not within a feature dataset you have to modify the third line by using a type of esriDTFeatureClass for getting those.
var workspaceFactory = (IWorkspaceFactory) Activator.CreateInstance(typeof(FileGDBWorkspaceFactoryClass));
var featureWorkspace = workspaceFactory.OpenFromFile(@"C:\data\OpenStreetMap\Germany.gdb", 0);
var datasets = featureWorkspace.Datasets[esriDatasetType.esriDTFeatureDataset];
datasets.Reset();
IDataset dataset;
while (null != (dataset = datasets.Next()))
{
var featureDataset = (IFeatureDataset) dataset;
var featureSubsets = featureDataset.Subsets;
IDataset subset;
while (null != (subset = featureSubsets.Next()))
{
if (esriDatasetType.esriDTFeatureClass == subset.Type)
{
var featureClass = (IFeatureClass) subset;
}
}
}
Happy coding
Product Manager
Developers and Location Services
Germany and Switzerland