[Mono-dev] ChangeType for Nullable

tut trofimich at ukr.net
Wed May 24 12:16:48 EDT 2006



Jerry Haltom wrote:
> 
> I wasn't aware that code would work on any .Net
> 
> "typeof" only runs on Type names.  typeof(int?) works. typeof(number)
> should not.
> 

I wrote incorrect schematic sample. Correct sample here:

object number = Convert.ChangeType("0", typeof(int?));

This code works fine:

object number = Convert.ChangeType("0", typeof(int));


--
View this message in context: http://www.nabble.com/ChangeType+for+Nullable-t1675856.html#a4544382
Sent from the Mono - Dev forum at Nabble.com.




More information about the Mono-devel-list mailing list