Convert integer enum to string

Posted by user216205 on Stack Overflow See other posts from Stack Overflow or by user216205
Published on 2010-03-29T17:21:44Z Indexed on 2010/04/13 7:22 UTC
Read the original article Hit count: 287

Filed under:
|
|

Hi Guys,

considering the following enum:

public enum LeadStatus 
{ 
    Cold = 1, 
    Warm = 2, 
    Hot = 3, 
    Quote = 5, 
    Convert = 6 
} 

How can I convert the integer value back to string when I pull the value from a database. I've tried:

DomainModel.LeadStatus status = (DomainModel.LeadStatus)Model.Status;

but all I seem to get is "status = 0"

© Stack Overflow or respective owner

Related posts about c#

Related posts about enums