Reputation: 63
I am working on sharepoint-2010 and I am new to sharepoint. I want to access List Item by Guid. So, how can I access. Please provide some reference or some class file to access that.
Thanks in advance.
Upvotes: 4
Views: 4703
Reputation: 17343
Use the SPList.GetItemByUniqueId method:
using (SPSite site = new SPSite(url))
{
using (SPWeb web = site.OpenWeb())
{
SPList list = web.Lists[listTitle];
SPListItem item = list.GetItemByUniqueId(itemGuid);
}
}
Upvotes: 2