I hit error in my code when cast integer data value to an enum data type. It was working yesterday. After some toubleshooting with trial and error, and I found that my field must be int data type in order casting to enum without error. SmallInt would not work.