【问题标题】:ClientContext object not updating properlyClientContext 对象未正确更新
【发布时间】:2013-06-19 12:44:53
【问题描述】:
ClientContext cl = new Microsoft.SharePoint.Client.ClientContext("http://" + "mysharepoint" + "/" + SubWeb);
System.Net.NetworkCredential cred = new System.Net.NetworkCredential("myuser", "mypass", "ntuni");

cl.Credentials = cred;

ListItemCollection result;
List qrtList = cl.Web.Lists.GetByTitle(QRT_LIST_NAME);
result = qrtList.GetItems(CamlQuery.CreateAllItemsQuery());
cl.Load(result);
cl.ExecuteQuery();

foreach (ListItem item in result)
{
    if (item.FieldValues["UniqueId"].ToString() == QrtId)
    {

        item.FieldValues["R_x00e9_ponse"] = r.ResponseTxt;
        item.Update();
        qrtList.Update();        
    }
}

cl.ExecuteQuery();

由于某种原因,一旦我访问共享点,我的对象就不会更新。这围绕着一个尝试捕获,没有任何东西被捕获。哈尔普?谢谢!

ps:添加新项目可以正常工作。

【问题讨论】:

    标签: c# .net sharepoint sharepoint-clientobject


    【解决方案1】:

    如果您使用您的应用添加项目,然后在 sharepoint 中修改它们...您需要重新加载您的列表项/列表,因为您的列表版本已过时

    ...您的问题需要澄清一下:

    1.需要更新的内容

    2.你在做什么来达到这个目的

    【讨论】:

      猜你喜欢
      • 2018-02-24
      • 2021-08-09
      • 1970-01-01
      • 1970-01-01
      • 2020-08-15
      • 2021-07-04
      • 2022-01-19
      • 2021-10-26
      • 1970-01-01
      相关资源
      最近更新 更多