在camlquery中有多个

时间:2014-10-03 07:33:54

标签: sharepoint-2010 caml

我正在尝试用3做一个camlquery,但我回到了一个例外:     值不在预期范围内

我已尝试将标记放在任何地方,但仍无法正常工作

List<string> columns = new List<string>();

                foreach (SP.Field fieldTemp in fieldColl)
                {
                    //logger.WriteInfo(fieldTemp.InternalName.ToString()); 
                    columns.Add("<FieldRef Name='" + fieldTemp.InternalName.ToString() + "' />");
                }
                //construit la query
                SP.ListItemCollection resultat = null;
                SP.CamlQuery query = new SP.CamlQuery();
                query.ViewXml = "<View Scope='RecursiveAll'>" +
                                "<Query>" +
                                "<Where>" +
                                    "<And>" +
                                        "<Eq>" +
                                            "<FieldRef Name='Ann_x00e9_e' />" +
                                            "<Value Type='Text'>" + year + "</Value>" +
                                        "</Eq>" +
                                            "<And>" +
                                            "<Eq>" +
                                                "<fieldref name='N_x00B0__x0020_circulaire' />" +
                                                "<value type='Text'>" + numCiruclaire + "</value>" +
                                            "</Eq>" +
                                            "<Eq>" +
                                                "<FieldRef Name='Doc_x0020_Language' />" +
                                                "<Value Type='Text'>" + lang + "</Value>" +
                                            "</Eq>" +
                                           "</And>" +
                                    "</And>" +
                                "</Where>" +
                                "</Query>" +
                                "<ViewFields>" +
                                //"<FieldRef Name='Modified' />"+ //i try this alors but still not work
                                    string.Join("", columns.ToArray()) +
                                "</ViewFields>" +
                                "</View>";
                resultat = list.GetItems(query);
                clientContext.Load(resultat);
                clientContext.ExecuteQuery();

如果我对这个唯一字段的位置进行查询,我也会得到例外

'N_x00B0__x0020_circulaire'

我检查了列表中字段的内部名称,这是正确的

1 个答案:

答案 0 :(得分:0)

问题来自第二个相等的'fileref'是小写而不是CamlCase