Thursday, August 15, 2013

Get SharePoint List Name from GUID


We have couple of errors recorded in ULS logs with List Id\GUID and we need to get the list name to troubleshoot further.

 Here is the code snippet to get SharePoint list Name from GUID.
 
SPSite Site= new SPSite("Your Site Name");
SPWeb Web= Site.OpenWeb();
Guid id = new Guid("Your LIST GUID");
SPList list = Web.Lists.GetList(id, true);
 
Hope this helps

No comments:

Post a Comment