I am trying to get the value of a list box using the SharePoint object model. The problem is that the value should be returned as the field name. The following is a snippet of code. The value is returned as "City" instead of the actual name of the city. I know that the value is not "City" because I checked it in the SPListItem Xml property. I tried both the display name and the internal name as a key. I also tried SPField.GetFieldValue, but the same result. What's happening?
SPListItemCollection items = list.GetItems(query);
foreach (SPListItem item in items)
{
SPField itemField;
itemField = item.Fields["City"].ToString();
}
source
share