Click here to Skip to main content
15,942,847 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
Hi,

I have list of data which are predefined, I don't want to store all those data in the database as it is and also I don't want to have separate table for those data. So I have used Enumerators and saved only the enumerators values like '1,3,4,5,6' in the database. Now I fetch the record as '1,3,4,5,6' and I have to check those values in the user interface. How do I get the string values from Enum by passing these IDs as comma separated value without using loop may be by using LINQ.


Thanks in advance
Posted

1 solution

Cast it to the enum type:
C#
MyEnum me = (MyEnum) myInteger;
Then just use the ToString override to get the enum value name:
C#
string s = me.ToString();
 
Share this answer
 
Comments
Beula Joyce 6-Jul-12 23:55pm    
I would like to get the values as comma separated when I pass the enum values as (1,2,3) and it should return (hot,cold,neutral)

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900