sharepoint 2010 获取讨论板话题的所有评论回复信息 Get all replies
2013-02-03 16:54
344 查看
前面提到在sharepoint 2010 如何给讨论板(Discussion)话题添加回复(Reply)信息(Message)
以下是如何通过程序,获取这些所有回复信息。
SPSecurity.RunWithElevatedPrivileges(delegate()
{
SPWeb web =
SPContext.Current.Web;
SPList list = web.Lists["工作组讨论"];
//This Query gets all items of the topic with ID=1
string str =
@"
<Where>
<Eq>
<FieldRef Name=""ParentFolderId"" />
<Value Type=""Integer"">1</Value>
</Eq>
</Where>
";
SPQuery query =
new SPQuery();
//This line makes the query search ib all folders
query.ViewAttributes =
"Scope=\"Recursive\"";
query.Query = str;
SPListItemCollection res = list.GetItems(query);
DataTable replyTable = res.GetDataTable();
DataList1.DataSource = replyTable;
DataList1.DataBind();
});
以下是如何通过程序,获取这些所有回复信息。
SPSecurity.RunWithElevatedPrivileges(delegate()
{
SPWeb web =
SPContext.Current.Web;
SPList list = web.Lists["工作组讨论"];
//This Query gets all items of the topic with ID=1
string str =
@"
<Where>
<Eq>
<FieldRef Name=""ParentFolderId"" />
<Value Type=""Integer"">1</Value>
</Eq>
</Where>
";
SPQuery query =
new SPQuery();
//This line makes the query search ib all folders
query.ViewAttributes =
"Scope=\"Recursive\"";
query.Query = str;
SPListItemCollection res = list.GetItems(query);
DataTable replyTable = res.GetDataTable();
DataList1.DataSource = replyTable;
DataList1.DataBind();
});
相关文章推荐
- sharepoint 2010 如何给讨论板(Discussion)话题添加回复(Reply)信息(Message)
- 【原】获取数据库(SQL SERVER 2005)的所有信息 Get all database information from SQL Server 2005 测试通过【想写基于数据库代码生成器可参考】
- 【原】获取数据库(SQL SERVER 2005)的所有信息 Get all database information from SQL Server 2005 测试通过
- 在sharepoint中获取Team Discussion中每个Topic 最后回复信息
- js 获取 sharepoint 2010 网站信息(title,id,language……)
- sharepoint 2010 如何用SocialCommentManager获取记事板评论数据
- WordPress获取所有页面的id函数: get_all_page_ids
- sharepoint 2010 获取文件小图标地址get document icon url
- sharepoint 2010 获取用户信息UserProfile方法
- SharePoint 2010 获取列表中所有数据(包括文件夹内)的方法
- 获取 SharePoint 2010 中所有的User Profile Service Application
- SharePoint 2010 获取列表中所有数据(包括文件夹内)的方法
- PHP - 获取头http客户端请求信息(getallheaders)
- Thread类的getAllStackTraces()方法获取虚拟机中所有线程的StackTraceElement对象,可以查看堆栈
- Sharepoint 2010 获取一个列表的所有字段,并转换成SQL语句
- sharepoint 2010 获取列表文件夹所有数据方法
- 本地音乐播放器MediaPlayer获取所有歌曲信息,getContentResolver()
- sharepoint 2010 讨论板回复页面 显示和隐藏(显示引用邮件)Hide/Show Quoted Messages
- SharePoint 2010 JavaScript Object Model获取列表下所有文件夹名称
- BeautifulSoup4----利用find_all和get方法来获取信息