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
Navigation
Archive
<March 2010>
SunMonTueWedThuFriSat
28123456
78910111213
14151617181920
21222324252627
28293031123
45678910
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)