Given an enum like:
enum Test
{
Hi=0x1,
Hello=0x2
}
From the database, I get either a 1 or 2.
I need to concatenate 0x (to display as hex value), when the query returns 1.
I concatenate 0x and when I assign, I get an invalid argument exception.
(Test)Enum.Parse(typeof(Test), reader.GetString(0));
How can this be done?
I think what you’re trying to do is this:
If so, try this:
Or perhaps I’ve misunderstood what your problem is.