Question

I have a integer column in the database which is nullable. So while creating the datamodel i made the property "int?". This way my insert/update statement is working as expected.

However when I try to select data from the table into the same datamodel, the field is not getting populated. What am i doing wrong ? Can somebody please suggest ?

Was it helpful?

Solution

There was a mistake. The database column was in fact "VARCHAR". So I changed the model property to String, and things are now working fine.

So it appears that though Simple.Data is able to select VARCHAR coumn value into int model property, it somehow was failing to convert into int?. Changing model property to String sorted out the issue of both insertion/selection.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top