Redian新闻
>
Linq to SharePoint 紧急求助
avatar
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??
avatar
s*o
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

相关阅读
logo
联系我们隐私协议©2024 redian.news
Redian新闻
Redian.news刊载任何文章,不代表同意其说法或描述,仅为提供更多信息,也不构成任何建议。文章信息的合法性及真实性由其作者负责,与Redian.news及其运营公司无关。欢迎投稿,如发现稿件侵权,或作者不愿在本网发表文章,请版权拥有者通知本网处理。