L
Lloyd Dupont
I have written a class which automatically fills up an object's field from a
DbDataReader.
I'm trying to do some data type conversion before assigning the fields.
Unfortunately Convert.ChangetType((long) x, typeof(Nullable<long>)); throw
an InvalidCastException.
So I wonder, how could I, from the type information such as
Type aType = typeof(Nullable<long>);
and an object
object obj = 42L;
convert the object obj to the type of aType?
DbDataReader.
I'm trying to do some data type conversion before assigning the fields.
Unfortunately Convert.ChangetType((long) x, typeof(Nullable<long>)); throw
an InvalidCastException.
So I wonder, how could I, from the type information such as
Type aType = typeof(Nullable<long>);
and an object
object obj = 42L;
convert the object obj to the type of aType?