您的位置:首页 > 其它

最近在做SharePoint开发时积累的几点知识

2009-12-12 14:35 363 查看
1、操作列表批量删除列表项 

代码

this.PersonNameCollection = "小李,小王";
DataTable dtPerson = web.Lists["Person"].Items.GetDataTable();
DataTable dtCustion = web.Lists["Custion"].Items.GetDataTable();
DataTable dtPersonCustion = web.Lists["PersonCustion"].Items.GetDataTable();
var qList = (from Person in dtPerson.AsEnumerable()
join PersonCustion in dtPersonCustion.AsEnumerable() on Person.Field<string>("PersonID") equals PersonCustion.Field<string>("PersonID")
join Custion in dtCustion.AsEnumerable() on PersonCustion.Field<string>("CustionID") equals Custion.Field<string>("CustionCode")
where this.PersonNameCollection.Contains(Person.Field<string>("Title")) //实现In子查询
orderby Custion.Field<string>("CustionCode")
select new
{
ParentCustionID = PersonCustion.Field<string>("CustionID").Substring(0, 2),
CustionID = PersonCustion.Field<string>("CustionID"),
CustionName = Custion.Field<string>("Title"),
CustionURL = Custion.Field<string>("URL")
}).Distinct(); //并返回不重复记录
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: