Linq to SharePoint 紧急求助# DotNet - 窗口里的风景
Z*i
1 楼
I have a list called PMPSectionList in which there is a field called
parentId which is a lookup that refer to the Id of another record in the
same list (like a forgeign key in database), I use SPMetal to create the
context and run the query like:
PMPSectionDataContext dc = new PMPSectionDataContext(SPContext.Current.Web.
Url)
var query = from PMPSectionListItem pmpItem in dc.PMPSectionList
where pmpItem.ParentID.Id == 2
select pmpItem;
But always get an error of "InvalidOperationException: The query uses
unsupported elements, such as references to more than one list, or the
projection of a complete entity by using EntityRef/EntitySet"
Anyone can help??
parentId which is a lookup that refer to the Id of another record in the
same list (like a forgeign key in database), I use SPMetal to create the
context and run the query like:
PMPSectionDataContext dc = new PMPSectionDataContext(SPContext.Current.Web.
Url)
var query = from PMPSectionListItem pmpItem in dc.PMPSectionList
where pmpItem.ParentID.Id == 2
select pmpItem;
But always get an error of "InvalidOperationException: The query uses
unsupported elements, such as references to more than one list, or the
projection of a complete entity by using EntityRef/EntitySet"
Anyone can help??