修改ListItem时出现Error: Invalid data has been used to update the list item. The field you are trying to update may be read only.
2010-01-19 11:14
1181 查看
执行以下代码时:
修改 listItem.Update();
改为使用
listItem.SystemUpdate(false);
SPSite site = new SPSite("http://sharepoint"); SPWeb web = site.OpenWeb(); SPListItem listItem = web.Lists["test_list"].Items[0]; listItem["Title"] = "new Title"; listItem.Update(); // this call will error out
解决办法:修改 listItem.Update();
改为使用
listItem.SystemUpdate(false);
相关文章推荐
- Source insight上修改samba共享ubuntu上内核源程序文件出现"Confirm by typing ‘yes' below"、"has been changed outside of the editor. Do you want to
- The object of type 'RectTransform' has been destroyed but you are still trying to access it
- You are trying to load data from a www stream which had the following error,Unsupported protocol
- The key you are authenticating with has been marked as read only的解决方法
- Windows下使用BeautifulSoup 出现You are trying to run the Python 2 version of Beautiful Soup under Python
- 安卓运行时出现“The connection to adb is down, and a severe error has occured.”“You must restart adb and Eclipse. ”“Please ensure that a
- 使用UNetbootin工具制作的CentOS 6.9镜像U盘在启动安装过程中出现:unable to read package metadata.this may be due to a missing repodata directory
- iOS真机运行出现The certificate used to sign "APP名" has either expired or has been revoked.
- MISCONF Redis is configured to save RDB snapshots, but is currently not able to persist on disk. Commands that may modify the data set are disabled. Please check Redis logs for details about the error
- a pointer to a bound function may only be used to call the function
- 'date' is an invalid value for the SoapElementAttribute.DataType property. The property may only be specified for primitive types.
- VS.NET 2003 Error - The project you are trying to open is a Web project. You need to open it by specifying its URL path.
- Error: String or binary data would be truncated. The statement has been terminated
- Git出现error: Your local changes to the following files would be overwritten by merge: ... Please, commit your changes or stash them before you can merge.的问题解决(Git代码冲突)
- "Failed to update database "c:\inetpub\wwwroot\WebSite1\App_Data\ASPNETDB.MDF" because the database is read-only."的解决办法
- System.Data.SqlClient.SqlError: The media set has 2 media families but only 1 are provided. All memb
- vs2005下出现“Session state can only be used when enableSessionState is set to true, either in a configuration file or in the Page directive”的解决方法
- 编译报错“a pointer to a bound function may only be used to call the function”的解决办法
- “Problem with MergeList” or “status file could not be parsed” error when trying to do an update?
- The data couldn’t be read because it has been corrupted