Everything SharePoint
Wednesday, September 7, 2011
Retrieving SharePoint List programatically
Code below gets you the list object
string srListURL = <list url>
SPSite mySite = new SPSite(strListURL);
SPWeb myWeb = mySite.OpenWeb();
try
{
SPList myList = myWeb.GetList(strListURL);
}
catch(Exception)
{
//error handling here
}
No comments:
Post a Comment
Newer Post
Older Post
Home
Subscribe to:
Post Comments (Atom)
No comments:
Post a Comment