我在 Sharepoint 2013 上编程,我使用 SPSiteDataQuery 类创建一个从自定义列表中获取信息的查询。我想知道两者的区别。
query.ViewFields = "<FieldRef Name='Title' />";
和
query.ViewFields = "<ListProperty Name='Title' />";
我在 Sharepoint 2013 上编程,我使用 SPSiteDataQuery 类创建一个从自定义列表中获取信息的查询。我想知道两者的区别。
query.ViewFields = "<FieldRef Name='Title' />";
和
query.ViewFields = "<ListProperty Name='Title' />";
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.