Take the 2-minute tour ×
SharePoint Stack Exchange is a question and answer site for SharePoint enthusiasts. It's 100% free, no registration required.

I am listing files from multiple folders using the below code:

SPSiteDataQuery q = new SPSiteDataQuery();
                    q.Lists = "<Lists BaseType='1'/>";
                    q.Query = "<Where> <Where>
<And><Neq><FieldRef Name='FSObjType'/><Value Type='Lookup'>1</Value></Neq>
<Contains><FieldRef  Name='ProjectProperty.Title' /><Value Type='Text'>Site_Name_Value_From_TextBox</Value></Contains>
</And>
</Where></Where>";

                q.Webs = "<Webs Scope='Recursive' />";
                q.ViewFields = "<FieldRef Name='ID' /><FieldRef Name='LinkFilename' /><FieldRef Name='File_x0020_Type' /><FieldRef Name='Title' /><FieldRef Name='FileRef' /><ListProperty Name='Title' /><ProjectProperty Name='Title' />";

the code is working fine for listing items, but i need to filter items by Site name and Library Name, i used

<Contains><FieldRef Name='ProjectProperty.Title' /><Value Type='Text'>Site_NAme</Value></Contains>

but i get no results, when i use Title or FileRef or any other field filter is working fine, what should i use instead of "ProjectProperty" and "ListProperty "??

share|improve this question

1 Answer 1

I hope this link is helpful to you:

MSDN: SPSiteDataQuery.Webs Property

share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.