I am attempting to update values in a SharePoint 2010 List using the Client Object Model. I have full control permission on the List so I don't think this is a permission problem.
My code is:
SP.ListItemCollection oListItemCol = oList.GetItems( query);ctx.Load(oListItemCol);
ctx.ExecuteQuery();
SP.ListItem li = oListItemCol[0];
li.FieldValues[intTrgtCol] = 123;
li.FieldValues[intESpace] = "no space";
li.FieldValues[foo1.InternalName] = "Moose";
li.Update();
ctx.ExecuteQuery();
ctx.Load(li);
ctx.ExecuteQuery();
I get the correct list item and the internal names are correct. After changing the FieldValues I can see that they are changed locally. The new values are not stored at the SharePoint site. The second ExecuteQuery sets the local values back to the original values. Can anyone see what I am doing wrong?
Thanks!