This is the piece of code that's throwing the exception
field.PropertyInfo.SetValue(row, dataReader[field.Name],null);
The field in the database is a number, nullable. On the other hand, the Property in the object is of type TerrainSequence , where TerrainSequence is an enumeration. When I try to do this conversion (int to TerrainSequence ) , this is the exception it throws.
Object of type 'System.Int32' cannot be converted to type 'System.Nullable`1[FairPlay.Data.Persistables.TerrainSequence]'.
Any idea on how to tackle this conversion

Converting int to nullable enumeration...
jdaddy18
One thing that bugs me is that you can do this:
int integer = 0;
TerrainSegmentEnum tsEnum = (TerrainSegmentEnum )integer;
but, you cant do this:
typeof(TerrainSegmentEnum ).IsAssignableFrom(typeof(int));
Any1 want to comment on this.. :S
DJacobson
i wrote this just to try something.. can any1 tell me whats wrong
[code]
int trueValue = (int )value;
return Convert.ChangeType(trueValue, typeof(int ));
[/code]
Its throwing the execption at the Convert.ChangeType method.