If dr(EDIData.STD_NUMBER).ToString() <> Nothing AndAlso dr(EDIData.STD_NUMBER).ToString() <> "" Then
oListItem = oList.GetItemById(dr("STD"))
oListItem.RefreshLoad()
oListItem(EDIData.REMARKS) = String.Empty
oListItem(EDIData.II_PROCESSED) = "TESTED"
-在此行之后产生了错误 oListItem.Update() clientContext.ExecuteQuery()
答案 0 :(得分:-1)
这可能是您除了问题外还传递的参数,您可以首先检查更新后的参数是否有问题。 推荐您浏览此网站:
https://docs.microsoft.com/en-us/previous-versions/office/developer/sharepoint-2010/ee539976(v%3doffice.14)
您可能需要的代码:
using System;
using Microsoft.SharePoint.Client;
using SP = Microsoft.SharePoint.Client;
namespace Microsoft.SDK.SharePointServices.Samples
{
class UpdateListItem
{
static void Main()
{
string siteUrl = "http://MyServer/sites/MySiteCollection";
ClientContext clientContext = new ClientContext(siteUrl);
SP.List oList = clientContext.Web.Lists.GetByTitle("Announcements");
ListItem oListItem = oList.Items.GetById(3);
oListItem["Title"] = "My Updated Title.";
oListItem.Update();
clientContext.ExecuteQuery();
}
}
}