You should have used Type Casting as we can use in any other language.
If your enum
is like this-
public enum Question
{
Role = 2,
ProjectFunding = 3,
TotalEmployee = 4,
NumberOfServers = 5,
TopBusinessConcern = 6
}
And you need to cast to an int
, then do this-
Question q = Question.Role;
.............
.............
int something = (int) q;
In C#, there are two types of casting:
char
->int
->long
->float
->double
double
->float
->long
->int
->char
More can be found in here.