Hi,
I'm looking for a way to create Enum types from values stored in a database table. This way I can add/edit values without having to recompile my VB.NET class library.
I have a table like this:
Type Index Value
CustomerType 0 Type1
CustomerType 1 Type2
CustomerType 2 Type3
OrderStatus 0 Status1
OrderStatus 1 Status2
I would like to convert the value to enums like this:
Enum CustomerType
Type1 = 0
Type2 = 1
Type3 = 2
End Enum
Enum OrderStatus
Status1 = 0
Status2 = 1
End Enum
I know there is a way to do this with EnumBuilder (System.Reflection.Emit), but I can't figure out how. Can someone help me with this?
Many thanx!