最近在做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(); //并返回不重复记录
代码
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(); //并返回不重复记录
相关文章推荐
- (转)Winform开发几个常用的开发经验及知识积累(一)
- Go语言知识积累——特点简介与windows开发环境搭建
- iOS开发之最近小知识总结二
- 8_后台开发零碎知识积累
- 【android 开发知识积累】——属性(Attribute)资源的使用和自定义View组件
- 【软件开发知识积累】深入理解HTTP 原理基础与变迁
- 分布式开发的几点基础知识
- .Net开发新的知识积累(Enum, protected,前台用后台和PageBase中定义的公用方法,不用ItemDataBound)
- 开发中遇到的一些小知识积累
- iOS开发-项目 知识分享与经验积累(一)
- Go语言知识积累:windows开发环境搭建
- Go语言知识积累:windows开发环境搭建
- WP7 开发 基础知识与问题积累
- asp.net开发积累小知识
- Winform开发几个常用的开发经验及知识积累(一)
- 黑马程序员-重置开发环境和基础知识积累
- Go语言知识积累——特点简介与windows开发环境搭建
- 驱动开发人员知识的积累
- mui 开发知识 积累总结-----puls.webview
- 基于WF4.0流程平台开发过程中的知识积累(二)多书签会签