标签:
//删除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;
}
标签:
原文地址:http://www.cnblogs.com/6xiaoxian9/p/5853723.html