How to convert SPFieldNumber into an int
How do I convert an SPFieldNumber
into an int
in C#? I tried to use Convert.ToInt32
but it doesn't seem to be work开发者_如何学编程ing.
You should be able to do something like:
Convert.ToInt32(MySPFieldNumber.GetFieldValue());
Convert.ToInt32(MySPFieldNumber.GetFieldValueAsText());
What if you tried to get a string representation of the SPFieldNumber object and then use Int32.Parse(spfieldnumber_string_value) ?
精彩评论