Group: Forum Members
Posts: 17,
Visits: 53
|
I just had this issue so I figured I'd post the answer on this old entry. It is because there is a type mismatch between your db field and the enum's type. By default Enums are Int types but stingy DBA's like me only use TinyInt's for field that are will be enum values. That translates into a byte type in .Net.
The solution is to change your enum to:
public enum InspectionType : byte
{
Foo= 0,
Bar= 1,
Zip= 2
}
Then it will work correctly.
|