tag:blogger.com,1999:blog-5765821788458763196.post8050998417385215850..comments2024-01-31T15:39:26.998+05:00Comments on Asim Sajjad: Convert Integer To Enum Instance in C#Asim Sajjadhttp://www.blogger.com/profile/15400122734095984737noreply@blogger.comBlogger5125tag:blogger.com,1999:blog-5765821788458763196.post-13331871594795551422009-04-05T11:03:00.000+05:002009-04-05T11:03:00.000+05:00Thanks Asim. I really appreciate your efforts and ...Thanks Asim. I really appreciate your efforts and quick help! :)ajnoreply@blogger.comtag:blogger.com,1999:blog-5765821788458763196.post-36556184251827998962009-04-05T10:48:00.000+05:002009-04-05T10:48:00.000+05:00aj, I am working on it "how to convert a string to...aj, I am working on it "how to convert a string to enum Instant" you will see a post on it :)Asim Sajjadhttps://www.blogger.com/profile/15400122734095984737noreply@blogger.comtag:blogger.com,1999:blog-5765821788458763196.post-41016892791747371902009-04-05T10:46:00.000+05:002009-04-05T10:46:00.000+05:00thanks asim for the clarification. can you please ...thanks asim for the clarification. can you please tell me the best way to convert an enum from string?ajnoreply@blogger.comtag:blogger.com,1999:blog-5765821788458763196.post-32167184587416735632009-04-05T10:37:00.000+05:002009-04-05T10:37:00.000+05:00aj,Yes you can convert it bye using your conversio...aj,Yes you can convert it bye using your conversion. But to verify that the converted enum named constant belong to the EmployeeType, you have to use the Enum.IsDefined, as the conversion didn't give any error or exception if for example you convert the value 5 to EmployeeType.Asim Sajjadhttps://www.blogger.com/profile/15400122734095984737noreply@blogger.comtag:blogger.com,1999:blog-5765821788458763196.post-23880476526330024412009-04-05T10:32:00.000+05:002009-04-05T10:32:00.000+05:00can't we just use (EmployeeType)intValuecan't we just use (EmployeeType)intValueajnoreply@blogger.com