Geeks With Blogs
John Haigh's Blog February 2009 Entries
Convert a string value to an Enum
To convert a string value to an Enum, which may be required after retrieving data from an SqlDataReader. To give more context an Order object is created/returned from a static method GetOrderByOrderId and the Order object has a property OrderStatus that is an Enum which needs to be converted as it is stored as a string variable in SQL Server database table. Example Enum OrderStatus: public Enum ArtifactType { Folder, File } Order Class to represent our Order Object: public class Order { public int ......

Posted On Saturday, February 28, 2009 5:10 PM

Copyright © John Haigh | Powered by: GeeksWithBlogs.net