English 中文(简体)
共享客户目标模型查询
原标题:Sharepoint Client Object Model query filter not working

我正在使用客户物体模型在一份清单中查询记录。 它按照独一无二的标题进行过滤,因此,我期望它只退回一份记录,而是回到整个清单。

该法典:

FieldLookupValue result = new FieldLookupValue();
List list = web.Lists.GetByTitle(lookupSourceList);
var query = new CamlQuery
                {
                   ViewXml =
                        string.Format(
                          "<View><Where><Eq><FieldRef Name= Title  /><Value Type= Text >{0}</Value></Eq></Where></View>",
                           lookupValue)
                };
var ls = list.GetItems(query);
ctx.Load(ls, li => li);
ctx.ExecuteQuery();
if (ls.Count == 1)
{
    result.LookupId = ls[0].Id;
}

return result;

这有什么错误? 它为什么要回到整个名单?

最佳回答

您在座标上失踪。

它希望这样做。

<View>
  <Query>
    <Where>
    <!-- -->
    </Where>
  </Query>
</View>

加马民族解放组织有时比严格! 只是给它一个尝试。

Thorsten

问题回答

暂无回答




相关问题
Anyone feel like passing it forward?

I m the only developer in my company, and am getting along well as an autodidact, but I know I m missing out on the education one gets from working with and having code reviewed by more senior devs. ...

NSArray s, Primitive types and Boxing Oh My!

I m pretty new to the Objective-C world and I have a long history with .net/C# so naturally I m inclined to use my C# wits. Now here s the question: I feel really inclined to create some type of ...

C# Marshal / Pinvoke CBitmap?

I cannot figure out how to marshal a C++ CBitmap to a C# Bitmap or Image class. My import looks like this: [DllImport(@"test.dll", CharSet = CharSet.Unicode)] public static extern IntPtr ...

How to Use Ghostscript DLL to convert PDF to PDF/A

How to user GhostScript DLL to convert PDF to PDF/A. I know I kind of have to call the exported function of gsdll32.dll whose name is gsapi_init_with_args, but how do i pass the right arguments? BTW, ...

Linqy no matchy

Maybe it s something I m doing wrong. I m just learning Linq because I m bored. And so far so good. I made a little program and it basically just outputs all matches (foreach) into a label control. ...

热门标签