Skip to main content
edited body; edited tags
Source Link
Ganesh Sanap - MVP
  • 46.4k
  • 22
  • 31
  • 63

I use SharepointSharePoint 2013 with the following code:

SPListItem listItem;
...
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.

I use Sharepoint 2013 with the following code:

SPListItem listItem;
...
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.

I use SharePoint 2013 with the following code:

SPListItem listItem;
...
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.

added 27 characters in body
Source Link

I use Sharepoint 2013 with the following code:

SPListItem listItem;
...
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.

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.

I use Sharepoint 2013 with the following code:

SPListItem listItem;
...
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.

Source Link

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.