Here's the code.
myDocument is an SPListItem.
string fieldName = "Document Category";
string internalFieldName = myDocument.Fields[fieldName].InternalName.ToString();
Type myType = myDocument[internalFieldName].GetType();
internalFieldName gets the value "Document_x0020_Category"
But myType = myDocument[internalFieldName].GetType() throws an exception error of
"Value does not fall within the expected range"??
If the fieldname is found in the fields collection, and returns the internal field name, why would using the internal field name as an indexer into the document throw an exception?
myDocument has a value in field "Document Category" when I view properties on the document in the document library! I am expecting the field type to be of
View Complete Post