<nativehr>0x80131904</nativehr><nativestack></nativestack>Error while Updating an Item value in Sharepoint 2010 Custom Tasklist.

Unanswered <nativehr>0x80131904</nativehr><nativestack></nativestack>Error while Updating an Item value in Sharepoint 2010 Custom Tasklist.

  • Monday, July 16, 2012 2:51 PM
     
      Has Code

    Hi All,

    I am getting the above mentioned error when I try to update a value in my custom tasklist.

    In a button click event, I will update the CompletionDate( DateTime column).

    I have the code as follows:

    SPListItem curTaskItem = list.Item[0];

    curTaskItem["CompletionDate"] = DateTime.Now; curTaskItem.Update();

    The intresting part is that I have the same code working fine on other lists.I have the same List schema here also.


    Thanks, Satish Bommideni "Success usually comes to those who are too busy to be looking for it."

All Replies

  • Monday, July 16, 2012 8:22 PM
     
     

    Hi,

    What there was in the logs?

    Are you sure the internal name of the field "CompletionDate" (Becareful is case sensitive).

    NicoBzh

  • Tuesday, July 17, 2012 8:25 AM
     
     

    Yes, I am sure of the column name and it's casing.

    It is 'CompletionDate' only.I am really vexed with this error which creeped up all of a sudden and making the code not to work on newly created list also.


    Thanks, Satish Bommideni "Success usually comes to those who are too busy to be looking for it."

  • Tuesday, July 17, 2012 8:27 AM
    Moderator
     
     

    Hi Satish,

    Per my research, the error 0x80131904 should be thrown from SQL Server side. It might be:
    Login failed for user 'domain account'
    or
    Insufficient SQL database permissions for user 'domain account' in database 'database name' on SQL Server instance 'sql server server/instance'

    So, I assume the two code snippets you are using are running from different application and to different SharePoint site. If I am wrong, please don't hesitate to let me know.

    To fix the SQL Server Login/Permission issue, please:
    Verify the account you are using for the current application
    Ensure the account has the permission to login the SQL Server, and has Read permission at least

    In addition, if the code are in a webpart/event handler or some SharePoint Development components, we can run the code in elevated privilege to fix the issue too:
    http://msdn.microsoft.com/en-us/library/microsoft.sharepoint.spsecurity.runwithelevatedprivileges.aspx

    Thanks,
    JC


    Jinchun Chen
    Forum Support
    Please remember to mark the replies as answers if they help and unmark them if they provide no help. If you have feedback for TechNet Subscriber Support, contact tnmff AT microsoft.com(Please replace AT with @)

  • Wednesday, July 18, 2012 1:33 PM
     
     

    Thnx for your response Jinchun Chen.I have the permissions on the DB, I have full control on the list that I have created.

    Any help in this regard.


    Thanks, Satish Bommideni "Success usually comes to those who are too busy to be looking for it."

  • Tuesday, July 31, 2012 6:23 AM
     
     

    Hi All,

    I really donno the reason, but the issue was resolved when I placed the same code in another port.

    Since I was unable to resolve the Issue on any new sitecollection created in the same port,I created a new site collection on another port and created same list (TaskList) with same columns and it is working fine.

    I am still not sure what went wrong in my previous port.


    Thanks, Satish Bommideni "Success usually comes to those who are too busy to be looking for it."