Skip to main content
1 of 3

SPListItem field resets to null after calling Update

I use Sharepoint 2013 with the following code:

listItem["MyCol"] = " "; // Space character.
Console.WriteLine($"listItem[\"MyCol\"] = {listItem["MyCol"]}"); // Here i see the space character.
listItem.Update();
Console.WriteLine($"listItem[\"MyCol\"] = {listItem["MyCol"]}"); // Here value is became null.

Looks like issue reproduces only for space character.