Hi,
Below code snippet is used to delete list column Programmatically in SharePoint.
Below code snippet is used to delete list column Programmatically in SharePoint.
public void DeleteColumn() { try { using (SPSite _oSite = new SPSite("http://ABC:8500")) { using (SPWeb _oWeb = _oSite.OpenWeb()) { SPList oLIst = _oWeb.Lists.TryGetList("Part Type"); SPField fld = oLIst.Fields["Title"]; fld.AllowDeletion = true; fld.Update(); fld.Delete(); _oWeb.AllowUnsafeUpdates = true; oLIst.Update(); _oWeb.AllowUnsafeUpdates = false; } } } catch (Exception ex) { throw; } }
0 comments:
Post a Comment