IWorkspaceFactory WSFact = new FileGDBWorkspaceFactoryClass(); IFeatureWorkspace FWS; FWS = WSFact.OpenFromFile("C:\\project\\terrain.gdb", 0)as IFeatureWorkspace;Solved! Go to Solution.
string filePath = @"C:\Elevation Files\srtm"; IWorkspaceFactory workspaceFactory = new RasterWorkspaceFactoryClass(); IRasterWorkspace rasterWorkspace = (IRasterWorkspace)workspaceFactory.OpenFromFile(filePath, 0);
if (RuntimeManager.Bind(ProductCode.Engine))
{
licenseController = licenseController ?? new AoInitializeClass();
esriLicenseStatus licenseStatus = licenseController.Initialize(ESRI.ArcGIS.esriSystem.esriLicenseProductCode.esriLicenseProductCodeEngine);
if (licenseStatus == esriLicenseStatus.esriLicenseAlreadyInitialized ||
licenseStatus == esriLicenseStatus.esriLicenseCheckedOut)
{
result = true;
}
}