SPWeb web = SPContext.Current.Web;
//Response.Write(web.Name+"??");
string selectStr = "SELECT * FROM Tasks WHERE [Title] CONTAINS 'my'"; //注意my后面不要多一个空格,否则要报错 Is|Contains|BeginsWith|=|!=|>|>=|<|<=
selectStr = SELECT * FROM Tasks WHERE [Title] BeginsWith 'my'";
selectStr = "SELECT * FROM Tasks WHERE [Due Date] is Null";
selectStr = "SELECT * FROM Tasks WHERE [Assigned To] BeginsWith 'hai' order by ID desc";
selectStr = "SELECT * FROM Tasks WHERE [Assigned To] BeginsWith 'hai' or [Due Date] is Null order by ID desc"
//以上几条查询语句 都成功! 千万注意最后不要 有 一个 空格 ! 如 Id desc "; desc后面只有有空格就报 Index was outside the bounds of the array. at CollaDec.Tools.FriendlyQuery.AnalyseQuery()
//当你条件判断 不再 Is|Contains|BeginsWith|=|!=|>|>=|<|<= 这几个之内 将报 Is|Contains|BeginsWith|Eq|Neq|Lt|Leq|Gt|Geq was expected. at CollaDec.Tools.FriendlyQuery.AnalyseQuery()错误 “
CollaDec.Tools.FriendlyQuery fq = new CollaDec.Tools.FriendlyQuery(web, selectStr);
fq.RowLimit = 5;
fq.Scope = CollaDec.Tools.FriendlyQuery.QueryScope.AllItemsAndFolders;
SPListItemCollection items = fq.GetItems();
//SPList list = fq.QueryList;
//Response.Write(list.Title);
foreach (SPListItem item in items)
{
Response.Write(item.Title + "<br />");
Response.Write(item["Due Date"] + "<br />");
}