/// <summary>
/// 删除字段值
/// </summary>
/// <param name="pCurrentLayer"></param>
/// <param name="fieldName"></param>
public static bool DeleteILayerField(ILayer pCurrentLayer, string fieldName)
{
try
{
IFeatureLayer pFeatureLayer = (IFeatureLayer)pCurrentLayer;
IFeatureClass pFeatureClass = pFeatureLayer.FeatureClass;
//
int pFieldIndex = pFeatureClass.FindField(fieldName);
IFields pFields = pFeatureClass.Fields;
IField pField = pFields.get_Field(pFieldIndex);
if (pField != null)
{
pFeatureClass.DeleteField(pField);
}
return true;
}
catch (Exception ex)
{
return false;
}
}
剩下的就是根据需要刷新数据,显示删除后的Fields信息