A
Andrus
Convert.ChangeType((DateTime?)DateTime.Now, typeof(DateTime?), null);
throws exception
Invalid cast from 'System.DateTime' to 'System.Nullable`1[[System.DateTime,
mscorlib, Version=2.0.5.0, Culture=neutral,
PublicKeyToken=7cec85d7bea7798e]]'.
How to fix this ?
How to create generic type converter with same parameters as
Convert.ChangeType which converts between value types (including nullable
value types) ?
Should we use lot if if statements to use casts to fix this
Convert.ChangeType() issue before calling it or is there better solution ?
Andrus.
throws exception
Invalid cast from 'System.DateTime' to 'System.Nullable`1[[System.DateTime,
mscorlib, Version=2.0.5.0, Culture=neutral,
PublicKeyToken=7cec85d7bea7798e]]'.
How to fix this ?
How to create generic type converter with same parameters as
Convert.ChangeType which converts between value types (including nullable
value types) ?
Should we use lot if if statements to use casts to fix this
Convert.ChangeType() issue before calling it or is there better solution ?
Andrus.