[quoted text, click to view] "Ibrahim." <Ibrahim@discussions.microsoft.com> wrote in message
news:E5B992AF-BFBB-4B46-9089-3B7AF710851E@microsoft.com...
> I have a enum structure like this ;
>
> [Flags]
> public enum days
> {
> Sun=1,
> Mon=2,
> Tue=4,
> Wed=8,
> Thur=16,
> Fri=32,
> Sat=64
> }
>
> now i sum only sun & fri & save to database table field
>
> int daysSelected = (int) days.sun | days.fri
>
> now i want to get the enum values from daysSelected again ?
Are you saying you want to TEST the value to see if a certain day is in
there (easy, Herf gave you the code) or do you want to get the enum NAMES
back out of the value, e.g., given 33 do you want to get "Fri" and "Sun"
from it? The second part is a little more complicated, but possible.