Programmatically get ListItemVersion using client object model SharePoint 2010

后端 未结 1 1201
情深已故
情深已故 2021-02-15 22:11

I have a scenario where I have to move all my data in a SharePoint 2010 list (name= \"VersionTestList\") to a SQL server database. Since versioning is enabled in the list, I wan

1条回答
  •  情歌与酒
    2021-02-15 22:43

    you can get older version file like this

    string versionItemUrl = file.ServerRelativeUrl.Replace(Path.GetFileName(file.ServerRelativeUrl),"") + _version.Url;
    File oldFile = web.GetFileByServerRelativeUrl(versionItemUrl); clientContext.Load(oldFile, f=>f.ListItemAllFields);
    clientContext.ExecuteQuery();

    0 讨论(0)
提交回复
热议问题