Life of the software engineer RSS 2.0
# Thursday, March 11, 2010

You've got an enum value and you want that value as a string, eg to store in a database.

Enum.GetName does the job for you.

Example: string myString = Enum.GetName(typeof(ExportType), this.ExportType);

Thursday, March 11, 2010 4:39:40 PM (GMT Standard Time, UTC+00:00)  #    Comments [0] -
General Programming
Name
E-mail
Home page

Comment (Some html is allowed: b, blockquote@cite, strike, strong) where the @ means "attribute." For example, you can use <a href="" title=""> or <blockquote cite="Scott">.  

Enter the code shown (prevents robots):

Live Comment Preview
Navigation
Archive
<July 2010>
SunMonTueWedThuFriSat
27282930123
45678910
11121314151617
18192021222324
25262728293031
1234567
About the author/Disclaimer

Disclaimer
The opinions expressed herein are my own personal opinions and do not represent my employer's view in any way.

© Copyright 2010
Send mail to the author(s)Daniel McAdam
Sign In
Statistics
Total Posts: 10
This Year: 1
This Month: 0
This Week: 0
Comments: 18
All Content © 2010, Daniel McAdam
DasBlog theme 'Business' created by Christoph De Baene (delarou)