Wednesday, January 7, 2015

Error when add new item by programmatically: 0x80131904

I had never loved the error, especially with the unknown error. See this:

<nativehr>0x80131904</nativehr><nativestack></nativestack>

The message is not friendly and there is no key in my mind. The stack trace shows seem a bit more details:


at Microsoft.SharePoint.Library.SPRequestInternalClass.AddOrUpdateItem(String bstrUrl,
at Microsoft.SharePoint.Library.SPRequest.AddOrUpdateItem(String bstrUrl, 
--- End of inner exception stack trace ---
at Microsoft.SharePoint.SPGlobal.HandleComException(COMException comEx)
at Microsoft.SharePoint.Library.SPRequest.AddOrUpdateItem(String bstrUrl,
at Microsoft.SharePoint.SPListItem.AddOrUpdateItem(Boolean bAdd, 
at Microsoft.SharePoint.SPListItem.UpdateInternal(Boolean bSystem,
at Microsoft.SharePoint.SPListItem.Update()

Basically I just add new item by programmatically and it throw exception.

Solution: I found the reason and resolved this with my situation. In my list, there is a column that work incorrectly. I could not access the value of that column, eventhough I could get the details of its. I remove that column out of the list's schema and then re-add into list. It worked!

No comments: