laptop and a wrench

Bug

"IWorkspace::get_DatasetNames(esriDatasetType.esriDTAny)" fails to list FeatureClasses that are inside FeatureDatasets.

Last Published: October 6, 2017 ArcGIS for Desktop
Bug ID Number NIM060535
SubmittedAugust 25, 2010
Last ModifiedJune 5, 2024
Applies toArcGIS for Desktop
Version found10.0
Program languageC#
Operating SystemWindows OS
Operating System VersionXP
StatusWill Not Be Addressed

Additional Information

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.

Workaround

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; } }

Steps to Reproduce

Bug ID: NIM060535

Software:

  • ArcGIS for Desktop

Get notified when the status of a bug changes

Download the Esri Support App

Discover more on this topic

Get help from ArcGIS experts

Contact technical support

Download the Esri Support App

Go to download options