Hi,
Could someone explain why this works the way it does..
string s = "55";
int i1 = Convert.ChangeType(s, typeof(int)); // this is ok
int? i2 = Convert.ChangeType(s, typeof(int?)); // this fails!
My opinion is that the normal Int32 and Nullable<Int32> shall have the same
features etc (more for the nullable). In the above example the conversion should be ok for both cases.
If the string wouldn't have been an ok number they should fail (exception) in
the same way.
(Preferrable maybe the Nullable<> cast shouldn't throw any exception and
return an instance without value.)
another nullable issue (maybe related):
http://lab.msdn.microsoft.com/produc...b-127f0fceeedb
Regards & TIA
Stefan