Solved! Go to Solution.
ArcGIS for Desktop 10.1 SP1
ArcObjects .NET SP1
Windows 8 (russian)
Visual Studio 2010
When I try to open feature class with russian symbols (e.g. "????????_???????") from file geodatabase programmatically (fws.OpenFeatureClass(name)), I get an "Table was not found" exception. Also I tried to open feature class with name in uppercase - same result.
Any ideas?
public List<string> listFeatClassInDataBase(Geoprocessor GP, string GDBPath , string Dataset) { //lista List<string> list = new List<string>(); GP.SetEnvironmentValue("workspace", @GDBPath); IGpEnumList fcs = GP.ListFeatureClasses("*", "", Dataset); string fc = fcs.Next(); while (fc != "") { list.Add(fc); fc = fcs.Next(); } return list; } private void SomeMethod() { List<string> featureClassList = listFeatClassInDataBase(GP,GDBPath, datasetName); foreach (string feature in featureClassList) { if(feature == "????????_???????") { featWorkspace.OpenFeatureClass(feature); } } }
ArcGIS for Desktop 10.1 SP1
ArcObjects .NET SP1
Windows 8 (russian)
Visual Studio 2010
When I try to open feature class with russian symbols (e.g. "????????_???????") from file geodatabase programmatically (fws.OpenFeatureClass(name)), I get an "Table was not found" exception. Also I tried to open feature class with name in uppercase - same result.
Any ideas?
public List<string> listFeatClassInDataBase(Geoprocessor GP, string GDBPath , string Dataset) { //lista List<string> list = new List<string>(); GP.SetEnvironmentValue("workspace", @GDBPath); IGpEnumList fcs = GP.ListFeatureClasses("*", "", Dataset); string fc = fcs.Next(); while (fc != "") { list.Add(fc); fc = fcs.Next(); } return list; } private void SomeMethod() { List<string> featureClassList = listFeatClassInDataBase(GP,GDBPath, datasetName); foreach (string feature in featureClassList) { if(feature == "????????_???????") { featWorkspace.OpenFeatureClass(feature); } } }
public List<string> GetAllFeatureClassNames() { List<string> names = new List<string>(); // Featureclasses in datase IEnumDatasetName enumDSNames = (_featureWorkspace as IWorkspace).get_DatasetNames(esriDatasetType.esriDTFeatureDataset); IDatasetName dsName = null; while ((dsName = enumDSNames.Next()) != null) { IEnumDatasetName dsFCNames = dsName.SubsetNames; if (dsFCNames != null) { IDatasetName dsFCName = null; while ((dsFCName = dsFCNames.Next()) != null) { if (dsFCName.Type == esriDatasetType.esriDTFeatureClass) names.Add(dsFCName.Name); } } } // Featureclasses in root IEnumDatasetName enumFCNames = (_featureWorkspace as IWorkspace).get_DatasetNames(esriDatasetType.esriDTFeatureClass); IDatasetName fcName = null; while ((fcName = enumFCNames.Next()) != null) { names.Add(fcName.Name); } return names; }