SQL, C#, VB, .net, asp, JavaScript, you name it. Code samples, Error messages and stuff like that. Please add coments if you think I said something stupid :D or if you have a better idea ... or anything at all ...
Friday, August 15, 2008
How to count enum elements in C#?
If you need to count the enum elements ...
this is how you do it:
int nYourNumber = Enum.GetValues(typeof(YourEnumName)).Length;
as always: if you have something neater ;) comment ... I'll update the post if needed ;)
No comments:
Post a Comment