Preface: Write down the code in the small problems encountered, help colleagues write a batch update document library Title field of the small program, originally thought on the update can be, 10 minutes can be done. Results 10 minutes later, the code has been written, the implementation of the error, debugging is no problem, just to update the things did not update. Then ask, the document library opened check in check out (do not judge the error) and version control, find the problem, update is not.
1, nonsense not much to say, above the figure and code.
SPFile file = Listitemcoll[j]. File;
File. CheckOut ();
File. Update ();
File. item["title"] = UpdateTo;
File. Update ();
File. Item.update ();
File. CheckIn ("Code Update ~ ~");
2, after the completion of the update, the following figure, the title is still home: tried update and systemupdate are not, online check the next there are not implemented, there is no solution;
3, after a trial, and finally a chance to find the problem, incredibly still have the following method, suddenly dawned, version did not update;
file.Item.UpdateOverwriteVersion();
4, so, take a look at version control, to determine their own judgments, the following figure:
Summary: Really is the issue of versioning, although the update succeeded, but not the major version, resulting in no display; a very small problem, encountered in writing here and share with you, hope to help people who encounter the same problems.
See more highlights of this column: http://www.bianceng.cnhttp://www.bianceng.cn/web/sharepoint/