【发布时间】:2011-11-22 12:22:35
【问题描述】:
XmlElement camlQuery = Build(); // how to implement this?
我有一个名为 Authors 的 SharePoint list,它有一个 genericId 字段。
如何为以下内容编写 CAML 查询:
Select Name from Authors where genericId = 1
然后将 camlQuery 传递给 ListItems 共享点 Web 服务:
http://msdn.microsoft.com/en-us/library/lists.lists.getlistitems(v=office.12).aspx
我尝试的是创建一个 xml 元素,如下所示:
XmlDocument xmlDoc = new XmlDocument();
XmlElement camlQuery = xmlDoc.CreateElement("Query");
camlQuery.InnerXml = "<Where><Lt><FieldRef Name='genericId'/><Value Type='Integer'>9</Value></Lt></Where>";
然后这被传递给GetListItems()服务(不知道Lt或Gt等是什么意思?)。
但它会抛出异常:
Exception of type 'Microsoft.SharePoint.SoapServer.SoapServerException' was thrown.
非常感谢,
【问题讨论】:
-
您需要深入研究异常以找到将为您/我们提供有关问题所在的更多信息的 ninner 异常。我认为 lt 和 gt 是大于和小于的运算符
标签: c# sharepoint caml