0

我在 Sharepoint 2013 上编程,我使用 SPSiteDataQuery 类创建一个从自定义列表中获取信息的查询。我想知道两者的区别。

query.ViewFields = "<FieldRef Name='Title' />";

query.ViewFields = "<ListProperty Name='Title' />";
4

1 回答 1

0

ListProperty allows you to tell SPSiteDataQuery to return particular properties of the list like Title and ListId. FieldRef tells SPSiteDataQuery to return particular field values for specific list item. Suppose you have list with two items and you set ViewFields property with one ListProperty tag for "ListId" of the list and one FieldRef tag for "Title" of the item. SPSiteDataQuery will return two items but they will have same value in "ListId" field because items are from the same list but they will have different values of "Title" field because they are different items.

于 2013-10-29T08:01:29.030 回答