SPQuery q = new SPQuery();
q.Query = "<Where><Eq><FieldRef Name='MyField'/><Value Type='Text'>ABC</Value></Eq></Where>";
q.ViewAttributes = "Scope=\"Recursive\"";
SPListItemCollection c = l.GetItems(q);
Console.WriteLine(c.Count);
on a list like with one element like
Folder, MyField='ABC'
was not returning the element.
Solution:
q.ViewAttributes = "Scope=\"RecursiveAll\"";
See here why ☺
No comments:
Post a Comment