The specified cast from a materialized 'System.Int16' type to a nullable 'System.Int32' type is not valid In C#
Based from the issue, the fix is to check the database field against the view model class. In my case, the database field is smallint (nullable).
So, the fix is to change the model code from int datatype:
To Int16 datatype:
:-)
So, the fix is to change the model code from int datatype:
public int? StockOnHand { get; set; }
public Int16? UnitsInStock { get; set; }
Comments
Post a Comment