Friday, December 10, 2010

Check if list exist in sharepoint / Get specific List in Sharepoint 2010

SPSite site = "sitename"; SPWeb Web = site.OpenWeb(); if (Web != null) { SPList list = Web.Lists.TryGetList("Your List Title"); if (list != null) { //do something list.Title = "Working Documents"; list.Update(); } }

No comments:

Post a Comment

Followers