码迷,mamicode.com
首页 > 其他好文 > 详细

sharepoint 读取文件夹中所有的数据

时间:2015-03-04 01:03:11      阅读:135      评论:0      收藏:0      [点我收藏+]

标签:

private void BindData()
         {
             SPWeb web = SPContext.Current.Web;
             SPList list = web.Lists["我的文档"];
             SPListItemCollection items = GetItems(list);
             GridView1.DataSource = items.GetDataTable();
             GridView1.DataBind();
         }
         private SPListItemCollection GetItems(SPList list)
         {
             SPQuery query = new SPQuery();
             query.Folder = list.RootFolder; ;
             query.ViewAttributes = "Scope=\"RecursiveAll\"";
             SPListItemCollection itemCollection = list.GetItems(query);
             return itemCollection;
         }

参考文献:http://blog.csdn.net/chenxinxian/article/details/8425166

sharepoint 读取文件夹中所有的数据

标签:

原文地址:http://www.cnblogs.com/Percy/p/4312225.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!