"IWorkspace::get_DatasetNames(esriDatasetType.esriDTAny)" fails to list FeatureClasses that are inside FeatureDatasets.
上次发布: October 6, 2017ArcGIS for Desktop
漏洞 ID 编号
NIM060535
已提交
August 25, 2010
上次修改时间
June 5, 2024
适用范围
ArcGIS for Desktop
找到的版本
10.0
编程语言
C#
操作系统
Windows OS
操作系统版本
XP
状态
Will Not Be Addressed
开发团队已考虑过该问题或请求,并决定不会解决该问题。 问题的“其他信息”部分可能包含进一步说明。
附加信息
This defect was submitted for a release of ArcGIS that is no longer supported. If this is still an issue in a supported release, please contact Technical Support.
解决办法
Use one of the below two procedures to access FeatureClasses which are inside FeatureDatasets.
Procedure 1:
Use "IFeatureWorkspace::OpenFeatureClass("<Name of FeatureClass>")"
Procedure 2:
Use the "GeoProcessor" class.
Sample Code:
ESRI.ArcGIS.Geoprocessor.Geoprocessor GP = new ESRI.ArcGIS.Geoprocessor.Geoprocessor();
// Set the input workspace environment and list all FeatureClasses And FeatureDatasets.
GP.SetEnvironmentValue("workspace", "….\Connection to csslsystem-146.sde");
string strDSetName = "";
string strFCName = "";
ESRI.ArcGIS.Geoprocessing.IGpEnumList FDSets = GP.ListDatasets("*", "");
if ((FDSets != null)) {
FDSets.Reset();
strDSetName = FDSets.Next();
while (!string.IsNullOrEmpty(strDSetName)) {
MessageBox.Show("Dataset : " + strDSetName);
ESRI.ArcGIS.Geoprocessing.IGpEnumList shapefiles = GP.ListFeatureClasses("*", "", strDSetName);
if ((shapefiles != null)) {
shapefiles.Reset();
strFCName = shapefiles.Next;
while (!string.IsNullOrEmpty(strFCName)) {
MessageBox.Show("Dataset : " + strDSetName + " - FeatureClass : " + strFCName);
strFCName = shapefiles.Next;
}
}
}
}
ESRI.ArcGIS.Geoprocessing.IGpEnumList shapefiles2 = GP.ListFeatureClasses("*", "", strDSetName);
if ((shapefiles2 != null)) {
shapefiles2.Reset();
strFCName = shapefiles2.Next;
while (!string.IsNullOrEmpty(strFCName)) {
MessageBox.Show("Standalone FeatureClass : " + strFCName);
strFCName = shapefiles2.Next;
}
}