简体   繁体   English

共享点列表上的CAML查询

[英]CAML query on sharepoint list

I have a sharepoint list with the following fields: 我有一个包含以下字段的共享点列表:

Product Name Product Description Price Product Type 产品名称产品描述价格产品类型


Product Type can be either a CD or DVD 产品类型可以是CD或DVD

I would like to be able to obtain all data/records on the list based on a CAML query for Product Type. 我希望能够基于CAML查询产品类型来获取列表中的所有数据/记录。 Here is my CAML query: 这是我的CAML查询:

string prodType1= "CD"; 字符串prodType1 =“ CD”; string prodType2= "DVD"; 字符串prodType2 =“ DVD”;

string camlquery = 
@"<Where>
<Eq>
<FieldRef Name='Products_x0020_Type'/>
<Value Type='Text'>" + prodType1 + @"</Value>
</Eq>
</Where>";

I want to be able to bring back all data/records for product type CD. 我希望能够调出产品类型CD的所有数据/记录。 How can I acieve this with CAML, if possible. 如果可能的话,我如何通过CAML来解决这一问题。 If not possible what other method would be recommended for this. 如果不可能的话,建议使用其他方法。

I have been scratching my head with this for a over a week now, any help will be greatly appreciated. 我已经为此花了一个多星期的时间,任何帮助将不胜感激。

Many Thanks in Advance 提前谢谢了

i'd suggest the U2B CamlQuery Builder .. it's the easiest way to build your queries and saves you a lot of trouble and time... 我建议使用U2B CamlQuery Builder ..这是构建查询并节省大量麻烦和时间的最简单方法。

when you finished building just go to the editor tab and copy the query (without the <query> tag);... 完成构建后,只需转到编辑器选项卡并复制查询(不带<query>标记); ...

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM