Z*********i 发帖数: 3422 | 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?? | s***o 发帖数: 2191 | 2 remove PMPSectionListItem in front of pmpItem
【在 Z*********i 的大作中提到】 : 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
|
|