站点图标 GIS开发者

如何判断一个featureclass是否存在

IEnumDatasetName pEnumDatasetName = pWorkspace.get_DatasetNames(esriDatasetType.esriDTFeatureClass);
            pEnumDatasetName.Reset();
            IDatasetName pDatasetName = pEnumDatasetName.Next();
            bool b_Find = false;

            while (pDatasetName != null)
                {
                    if (pDatasetName.Name == strName)
                    {
                        b_Find = true;
                        break;
                    }
                    pDatasetName = pEnumDatasetName.Next();
                }
当然还有FeatureDataset中也要检查,(esriDatasetType.esriDTFeatureDataset),要用到FeatureDatasetName.SubsetNames,具体查看帮助文档

转载自:https://blog.csdn.net/lockener/article/details/7814950

退出移动版