Tuesday, January 20, 2015

Updating a column for a particular item in a list 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();

No comments:

Post a Comment