Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
ENUM Woes
Message
General information
Forum:
ASP.NET
Category:
Coding, syntax and commands
Title:
Miscellaneous
Thread ID:
01248158
Message ID:
01248336
Views:
22
I like Mike's reply better than my reply, but maybe it will explain some things about enums.
namespace MyProject
{
    public enum DatabaseType
    {
        MSSQL,
        Oracle
    }

    class MyClass
    {
       public int iDataBaseType = (int)DatabaseType.MSSQL; 
    }
}
You always have to cast the enum to the underlaying type (default is int if not specified). I don't know why they implemented it this way but oh well. My latest enum woe is that I use a guid as an enum type; a guid is a value type and is just a big number. I still like enums.
Semper ubi sub ubi.
Previous
Reply
Map
View

Click here to load this message in the networking platform