更新列表项引发异常 [英] Updating List Item Throws Exception

查看:85
本文介绍了更新列表项引发异常的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

最近,我已将SharePoint网站从2007迁移到SP2010.迁移后,我能够解决一些问题,但无法解决特定自定义列表上的错误.我可以将项目添加到列表中,但是当我更新列表中的现有项目时,会引发以下异常

 System.Runtime.InteropServices.COMException:异常 from  HRESULT:0x80131904
 在Microsoft.SharePoint.Library.SPRequestInternalClass.AddOrUpdateItem(String bstrUrl,String bstrListName,布尔bAdd,布尔bSystemUpdate,布尔bPreserveItemVersion,布尔bUpdateNoVersion,Int32& plID,字符串& pbstrGuid,GUId pbstrNewDocId,布尔b&b; Object& pvarAttachmentContents,Object& pvarProperties,布尔bCheckOut,布尔bCheckin,布尔bMigration,布尔bPublish,字符串bstrFileName,ISP2DSafeArrayWriter pListDataValidationCallback,ISP2DSafeArrayWriter pRestrictInsertCallback,ISP2DSafeArrayWField
 在Microsoft.SharePoint.Library.SPRequest.AddOrUpdateItem(String bstrUrl,String bstrListName,Boolean bAdd,Boolean bSystemUpdate,Boolean bPreserveItemVersion,Boolean bUpdateNoVersion,Int32& plID,String& pbstrGuid,Guid pbstrNewDocId,布尔bHasNewvar,对象b Object& pvarAttachmentContents,Object& pvarProperties,布尔bCheckOut,布尔bCheckin,布尔bMigration,布尔bPublish,字符串bstrFileName,ISP2DSafeArrayWriter pListDataValidationCallback,ISP2DSafeArrayWriter pRestrictInsertCallback,ISP2DSafeArrayW

将项目事件接收器类与列表关联,并且在调试代码时成功完成了关于ItemUpdating事件的自定义代码.在ItemUpdating事件上执行自定义代码后,应用程序将引发上述异常.

在SharePoint迁移过程中,有人遇到过这个问题吗?

解决方案

您已调试了事件接收器,但是否在产生异常的相同环境中进行了调试? ULS中有什么显示吗?如果没有,请尝试在代码中添加一些跟踪语句,以帮助识别可能的问题.


Recently I have migrated SharePoint site from 2007 to SP 2010. I was able fix few issues after the migraion, but I am unable to fix the error on specific custom list. I am able to add items to the list, but when I update existing items on the list it''s throwing the following exception

System.Runtime.InteropServices.COMException: Exception from HRESULT: 0x80131904
 at Microsoft.SharePoint.Library.SPRequestInternalClass.AddOrUpdateItem(String bstrUrl, String bstrListName, Boolean bAdd, Boolean bSystemUpdate, Boolean bPreserveItemVersion, Boolean bUpdateNoVersion, Int32& plID, String& pbstrGuid, Guid pbstrNewDocId, Boolean bHasNewDocId, String bstrVersion, Object& pvarAttachmentNames, Object& pvarAttachmentContents, Object& pvarProperties, Boolean bCheckOut, Boolean bCheckin, Boolean bMigration, Boolean bPublish, String bstrFileName, ISP2DSafeArrayWriter pListDataValidationCallback, ISP2DSafeArrayWriter pRestrictInsertCallback, ISP2DSafeArrayWriter pUniqueFieldCallback)
 at Microsoft.SharePoint.Library.SPRequest.AddOrUpdateItem(String bstrUrl, String bstrListName, Boolean bAdd, Boolean bSystemUpdate, Boolean bPreserveItemVersion, Boolean bUpdateNoVersion, Int32& plID, String& pbstrGuid, Guid pbstrNewDocId, Boolean bHasNewDocId, String bstrVersion, Object& pvarAttachmentNames, Object& pvarAttachmentContents, Object& pvarProperties, Boolean bCheckOut, Boolean bCheckin, Boolean bMigration, Boolean bPublish, String bstrFileName, ISP2DSafeArrayWriter pListDataValidationCallback, ISP2DSafeArrayWriter pRestrictInsertCallback, ISP2DSafeArrayWriter pUniqueFieldCallback)



An item event receiver class is associated to the list and the custom code on ItemUpdating event has been successful when debugging the code. Application throws the above exception after executing custom code on ItemUpdating event.

Did anyone come across this issue during SharePoint migration??

解决方案

You have debugged the event receiver but was that in the same environment that is producing the exception? Is there anything showing up in the ULS? If not, try adding some trace statements to your code to help identify possible problems.


这篇关于更新列表项引发异常的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆