本文介绍了使用SPCAMLHELPONLINE工具生成的CAML代码在C#代码中出现错误.的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我使用此工具(http://sharepoint-works.blogspot.com/2012/05/using-caml-query-builder-for-sharepoint.html)创建CAML查询,并在该工具中检查结果而且看起来还不错.然后,我单击复制代码并将生成的代码粘贴到我的C#中 VS2017,但从SPQuery的启动中得到了一个错误.有人可以告诉我如何解决此错误吗?谢谢.

I use this tool (http://sharepoint-works.blogspot.com/2012/05/using-caml-query-builder-for-sharepoint.html) to create a CAML query, check the result in the tool and it looks fine.  I then clicked the copy code and paste the generated code into my C# VS2017 but I got an error from the initiation of SPQuery.  Can someone tell me how to resolve this error?  Thank you.

           var oQuery = new SPQuery();
           oQuery.Query = sQuery;
           oQuery.ViewFields = sViewFields;
           oQuery.ViewAttributes = sViewAttrs;
           oQuery.RowLimit = iRowLimit;

           SPListItemCollection collListItems = oList.GetItems(oQuery);

           foreach(collListItems中的SPListItem oListItem)
           {
           }

            var oQuery = new SPQuery();
            oQuery.Query = sQuery;
            oQuery.ViewFields = sViewFields;
            oQuery.ViewAttributes = sViewAttrs;
            oQuery.RowLimit = iRowLimit;

            SPListItemCollection collListItems = oList.GetItems(oQuery);

            foreach (SPListItem oListItem in collListItems)
            {
            }

谢谢

推荐答案

请提供足够的信息.


这篇关于使用SPCAMLHELPONLINE工具生成的CAML代码在C#代码中出现错误.的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

05-24 13:58