posted 10/30/2009 by Vijendra Shakya
Here I have discuses find name of Enum from Enum value. I have a Enum like:
public enum EnumName { Vijendra=1, Singh=2, Shakya=3 }
I have the value of this Enum in my database table, when I fetch that value from database then we want to show this value as Enum name. For example in my database there is 2 when I retrieve it from database then I want to show it “Singh” instead of 2.I have done this as follows:
int enumValue = 2//suppose this value is retrieve from databse string strName = ((EnumName)enumValue).ToString() strName have the Enum name which have value 2.
What kind of email newsletter would you prefer to receive from CodeAsp.Net?18