Update list item using LINQ

SPListItem resultItem = (from SPListItem oItem in oWeb.Lists["CustomList"].Items
                         where Convert.ToString(oItem["ColumnName"]) == 'Value'
                         select oItem).First();
resultItem["Title"] = "Sample";
resultItem.Update();

Comments

Popular posts from this blog

IRM and the Object Model

This content database has a schema version which is not supported in this farm

Activate and Deactivate Feature through PowerShell