When you want to retrieve string values, use this type of strategy.
private string GetFieldValue(SPListItem li,string FieldName)
{
var field = li.Fields.GetField(FieldName);
object value = li[FieldName];
return field.GetFieldValueAsText(value);
}
By doing a ListItem["FieldName"].Tostring(), you're running the risk of getting data back in a way that you dont expect. For Example, if your column is a Lookup Column, the data will come back as "0#Value". That's because Sharepoint saves the Option selected from the lookup list.
The method above is safe if you want to return strings only. When you want to Cast the type of the column/field , use this type of strategy:
SPFieldCurrency priceField = (SPFieldCurrency)item.Fields.GetFieldByInternalName("Retail_x0020_Price");
Read more on the subject here :
http://msdn.microsoft.com/en-us/library/ff521580(v=office.14).aspx