J
jmnobre
Good morning,
Does anyone knows why:
Activator.CreateInstance( typeof( decimal? ), new object[]
{ 10M } ).GetType().FullName
returns "System.Decimal" ??
Also,
Convert.ChangeType( Activator.CreateInstance( typeof( decimal? ), new
object[]{ 10M } ), typeof( decimal? ) )
gives an InvalidCastException saying that it cannot convert from
decimal to decimal?.
I do need to create Nullable<> instances base on runtime info... but I
just find out that this is not the way....
Any help would be appreciated.
Thanks in advance
jmn
Does anyone knows why:
Activator.CreateInstance( typeof( decimal? ), new object[]
{ 10M } ).GetType().FullName
returns "System.Decimal" ??
Also,
Convert.ChangeType( Activator.CreateInstance( typeof( decimal? ), new
object[]{ 10M } ), typeof( decimal? ) )
gives an InvalidCastException saying that it cannot convert from
decimal to decimal?.
I do need to create Nullable<> instances base on runtime info... but I
just find out that this is not the way....
Any help would be appreciated.
Thanks in advance
jmn