G
Guest
Hello all.
First of all, I am not sure this is the place to post my question, but I
didn't find a more apropriate one.
The problem: I try to fill some fields of an object with values from a
database.
Because some database fields are nullable, I use nullable types in my object.
So, to set the value of an int? I write:
FieldInfo field; // age
DataRow dataRow;
//int? man.age
....
field.SetValue(man, dataRow["age"], null);
This code throws an error.
Can anybody help?
Thanks.
First of all, I am not sure this is the place to post my question, but I
didn't find a more apropriate one.
The problem: I try to fill some fields of an object with values from a
database.
Because some database fields are nullable, I use nullable types in my object.
So, to set the value of an int? I write:
FieldInfo field; // age
DataRow dataRow;
//int? man.age
....
field.SetValue(man, dataRow["age"], null);
This code throws an error.
Can anybody help?
Thanks.