What is the difference between SPListItem.SystemUpdate and SPListItem.Update Method (Microsoft.SharePoint):
SPListItem.SystemUpdate:
Updates the database(Sharepoint list) with changes that are made to the list item, without effecting changes in the Modified Time or Modified By fields.
SPListItem.SystemUpdate Overloaded Method:
SPListItem.SystemUpdate(): Updates the database with changes made to the list item, without effecting changes in the Modified or Modified By fields.
SPListItem.SystemUpdate(Boolean): Updates the database with changes that are made to the list item, without effecting changes in the Modified Time or Modified By fields, or optionally, the item version.
Example:
{codecitation class="brush: xml; gutter: true;" width="650px"}
//Take the reference of that item
SPListItem listItem = listItemCOll[icount];
listItem["FIRST_NAME"] = “Amit”;
listItem["LAST_NAME"] = “Kumar”;
listItem["EMAIL_ADDR"] = “mcapassion[at]gmail.com”;
//Update the Item
listItem.SystemUpdate(false);
{/codecitation}
The argument false informs the SP object Model not increment versions.
SPListItem.Update:
SPListItem.Update(): Updates the database(Sharepoint list) with changes that are made to the list item/new version of item, and changes in the Modified Time or Modified By fields.
Example: {codecitation class="brush: xml; gutter: true;" width="650px"}
//Take the reference of that item
SPListItem listItem = listItemCOll[icount];
listItem["FIRST_NAME"] = “Amit”;
listItem["LAST_NAME"] = “Kumar”;
listItem["EMAIL_ADDR"] = “mcapassion[at]gmail.com”;
//Update the Item
listItem.Update(); {/codecitation} Thank you | About the Author |
 | | Amit Kumar | Description :5+ years of work experience in ASP.NET C# applications development and database design. 2+ years in SharePoint Worked on SQL Server Worked on Object oriented design and UML Programming Languages/Framework : C#.Net, VB.Net, VB 6.0, VBA,Com/DCom Web Languages : HTML, DHTML, ASP, JavaScript, ASP.Net Operating Systems : WIN 98/2000NT/XP/2003 Server DBMS/RDBMS : MS-Access 2000, ORACLE 8.0, MS-SQL Server 2000, MS-SQL Server 2005 Designing Tools : Microsoft Visio 2003 Versioning Tools : Microsoft Visual Source Safe 6.0 Content Management : Plumtree 4.5 WS, SharePoint (MOSS) Experience in developing Portals using Plumtree 4.5 WS and SharePoint. Experience in user-interface design, user controls, web parts and layout for web-based applications using HTML, CSS, ASP and ASP.net.
Occupation :Software Engineer Company : Haryana. Location : India |
|
|