using (SPSite site = newSPSite("http://serverName:1111/sites/sample"))
{ using (SPWeb web = site.RootWeb)
{ SPList list = web.Lists.TryGetList("BugsList"); foreach (SPField field in list.Fields)
{ if (field.Title == "Choice")
{
field.DefaultValue = null;
field.Update();
}
}
list.Update();
}
}
{ using (SPWeb web = site.RootWeb)
{ SPList list = web.Lists.TryGetList("BugsList"); foreach (SPField field in list.Fields)
{ if (field.Title == "Choice")
{
field.DefaultValue = null;
field.Update();
}
}
list.Update();
}
}
No comments:
Post a Comment