我有一個帶有託管元數據列的SPList,這裏是我的caml查詢。撰寫CAML查詢以查詢包含託管元數據列的SPList
/// This caml query doesn't work
SPQuery oQuery = new SPQuery();
string strQuery = @"<Query><Where><In><FieldRef LookupId=""TRUE"" Name=""TaxonomyColumn"" /><Values><Value Type=""Text"">7392ec1d-3f35-4c5b-b6ad-f80ff15ed718</Value></Values></In></Where></Query>";
oQuery.Query = strQuery;
/// This linq query works exactly fine
var itms = (from SPListItem itm in oList.Items
where itm["TaxonomyColumn"].ToString().Contains("7392ec1d-3f35-4c5b-b6ad-f80ff15ed718")
select itm).ToList();
我的問題是,我需要使用CAML查詢出於某種原因,我不能只是弄清楚如何撰寫我的CAML查詢到上詢問名單工作的方式,其中列有管理的元數據列。
請幫幫我。謝謝。
http://sharepointfordeveloper.blogspot.com/2012/05/sharepoint-2010-using-in-operator-in.html 結束標記丟失。即使是微軟的例子也沒有這些標籤,每個人都會複製和粘貼,就像它的工作原理一樣(人們甚至認爲它是工作答案,這更令人困惑)。 如果沒有這些結束標記,我會得到一個運行時錯誤,如預期的那樣,關於這些結束標記丟失。 – DiggyJohn 2014-09-12 15:26:11