(Sharepoint 2007) 访问 Sharepoint 文档库并在 GridView 中显示其记录
我们创建了一个文档库。 用户将他的数据上传到其中。 我想在一页上显示用户上传的所有文档。 (假设我登录系统,然后在页面加载时我需要从我上传的文档库中获取所有记录) 文档库中可能有多个文件夹, 表示类似于以下
Root1 的 结构 ->文件夹1 ->文件夹2 根2 ->Folder1
所以我需要搜索该文档库的每个文件夹并在 gridview 中显示结果。 如果您对此有任何参考,请帮忙提供。 谢谢。
We have created one Document Library.
User will upload his data to it.
I want to display All the documents uploaded by user on one page.
(Suppose I am login to the system then on pageload I need to fetch all the records from document library which are uploaded by me)
Document library may have more than one folders inside it,
means structure like following
Root1
->Folder1
->Folder2
Root2
->Folder1
So I need to search in every folder of this document library and show result in gridview.
Please help and provide if you have any reference to this.
Thanks.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
您可以使用 CAML 查询来实现此目的,为了构建您的查询,您可以使用一个非常好的工具,名为 U2U CAML Builder 生成您想要的查询。
在 C# 部分中,您创建
SPQuery
并将从工具生成的 CAML 查询分配为字符串并将其分配给它。要在所有文件夹中搜索,只需更新 ViewAttributes 属性,如下所示
调用它
,并像
那样 list
是您的SPList
对象You can achieve this using CAML query, to build your query you can use a very nice tool called U2U CAML Builder to generate the query like you want.
In C# part you create
SPQuery
and assign the generated CAML query from the tool as string and assign it to itTo Search in all folders just update the ViewAttributes property like the following
and call it like
where
list
is yourSPList
object