SPListItem.Update() 与 SPListItem.SystemUpdate()区别
生活随笔
收集整理的這篇文章主要介紹了
SPListItem.Update() 与 SPListItem.SystemUpdate()区别
小編覺(jué)得挺不錯(cuò)的,現(xiàn)在分享給大家,幫大家做個(gè)參考.
大家在SharePoint開(kāi)發(fā)方面都用過(guò)SPListItem.Update 方法,不過(guò)您可能沒(méi)有用過(guò)SPListItem.SystemUpdate方法,現(xiàn)在來(lái)介紹一下這兩個(gè)方法的區(qū)別;
先看一下SDK中的說(shuō)明:- SPListItem.Update, Updates the database with changes that are made to the list item.;
- SPListItem.SystemUpdate, Updates the database with changes that are made to the list item, without effecting changes in the Modified Time or Modified By fields.
??? 從SDK的說(shuō)明中可以看出,兩個(gè)方法都是將SPListItem的更改保存到數(shù)據(jù)庫(kù),但Update方法會(huì)更新修改時(shí)間(=當(dāng)前時(shí)間)、修改者(=當(dāng)前用戶),如果此列表啟用了版本控制功能,Update方法還會(huì)影響Item的版本,而SPListItem.SystemUpdate方法則不會(huì)影響修改時(shí)間和修改者,在調(diào)用SystemUpdate方法時(shí)還可以使用參數(shù)來(lái)控制是否創(chuàng)建新版本。
轉(zhuǎn)載于:https://www.cnblogs.com/luofeng99/archive/2011/05/20/2177611.html
總結(jié)
以上是生活随笔為你收集整理的SPListItem.Update() 与 SPListItem.SystemUpdate()区别的全部?jī)?nèi)容,希望文章能夠幫你解決所遇到的問(wèn)題。
- 上一篇: 歼20与歼16产能创新高!
- 下一篇: [图论]强联通分量+缩点 Summer