首页 > 代码库 > arcgis AE删除SDE featureClass数据
arcgis AE删除SDE featureClass数据
//删除SDE图层
public static bool DeleteSDELayer(ESRI.ArcGIS.Geodatabase.IWorkspace m_pWorkspace, string SDEDSname )
{
try
{
ESRI.ArcGIS.Geodatabase.IEnumDatasetName pEnumDsName = m_pWorkspace.get_DatasetNames(ESRI.ArcGIS.Geodatabase.esriDatasetType.esriDTFeatureClass);
pEnumDsName.Reset();
ESRI.ArcGIS.Geodatabase.IDatasetName pSDEDSname = pEnumDsName.Next();
while (pSDEDSname != null)
{
if (pSDEDSname.Name.ToUpper().EndsWith(SDEDSname.ToUpper()))
{
break;
}
}
pSDEDSname = pEnumDsName.Next();
}
if (pSDEDSname != null)
{
ESRI.ArcGIS.Geodatabase.IFeatureWorkspace pFWS = m_pWorkspace as ESRI.ArcGIS.Geodatabase.IFeatureWorkspace;
ESRI.ArcGIS.Geodatabase.IFeatureWorkspaceManage pFWSM;
pFWSM = (ESRI.ArcGIS.Geodatabase.IFeatureWorkspaceManage)pFWS;
pFWSM.DeleteByName(pSDEDSname);
}
}
catch (Exception ex)
{
return false;
}
return true;
}
arcgis AE删除SDE featureClass数据