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 ?

有帮助吗?

解决方案

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.

许可以下: CC-BY-SA归因
不隶属于 StackOverflow
scroll top