How to get values from Enum?

 Posted by Rajesh_Kumar on 1/21/2014 | Category: C# Interview questions | Views: 1138 | Points: 40
Answer:

Suppose i have below Enum,

public enum DB_Mode

{
New,
Edit,
Update
};

string mode_value = Enum.GetName(typeof(DB_Mode),
DB_Mode.New);
MessageBox.Show(mode_value);


Output would be:- New


Asked In: Many Interviews | Alert Moderator 

Comments or Responses

Login to post response