Thursday, January 3, 2013

Delete\Remove custom Site Colums using SharePoint object model

Scenario: Delete\Remove Site Columns using SharePoint Object model code

Solution:  Add a feature receiver and in FeatureUninstalling write below code
SPWeb myWeb = properties.Feature.Parent as SPWeb;
myWeb.Fields["{GUID of Site column to delete}"].Delete();