To retrieve an Enum member given its name, use the ConvertFrom() method of the TypeConverter class and cast the result to your Enum type:
Taken from 'Enum Tips' by Alberto Venditti
'' on Sat, 24 Jul 2004 22:29:26 GMT, writes:
'Omer van Kloeten' on Wed, 21 Apr 2004 14:15:27 GMT, writes:
Either that or you could use Enum.Parse. It works three times as fast. http://www.codeproject.com/useritems/EnumTips.asp?df=100&forumid=38264&select=798012#xx798012xx
URL: http://weblogs.asp.net/OKloeten/
Add your comment.
name
comment
homepage
Back to How to match a string value to its equivalent Enum value.
.: bookmark at Del.icio.us! :: reddit this :.