代碼如下:請問 “ query.Query = string.Format("<Where><BeginsWith><FieldRef Name='Title' /><Value Type='Text'>'c'</Value></BeginsWith></Where>");”
查詢出的是哪些值?沒分了,不好意思。
using (SPSite site = new SPSite("http://10.148.8.77:2000/Pages/Default.aspx"))
{
using (SPWeb web =site.AllWebs["Docs"])
{
SPList list = web.Lists["文件"];
SPQuery query = new SPQuery();
query.Query = string.Format("<Where><BeginsWith><FieldRef Name='Title' /><Value Type='Text'>'c'</Value></BeginsWith></Where>");
foreach (SPListItem item in list.GetItems(query))
{
s.Add(item.Title);
}
}
}