Tuesday, September 9, 2014

SPSiteDataQuery - filter by file Title - Can I use variable for the filter value?

I use SPsiteDataQuery to search across multiple lists and filter by file title. I have the file title information in a variable.


Can I use variable in the filter value?



string fileName = "Policies.doc"

SPSiteDataQuery spQry = new SPSiteDataQuery();

spQry.ViewFields = "<FieldRef Name='Title'/><Value Type='Text'>fileName</Value>"




No comments:

Post a Comment