473,513 Members | 2,693 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Creating Enum from SQL database table values

1 New Member
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!
Nov 29 '07 #1
0 1109

Sign in to post your reply or Sign up for a free account.

Similar topics

6
2701
by: gonzalo briceno | last post by:
I have been using phplib for a while and I really like the framework except for form creation. Maybe it is me but I in my opinion there isn't a good way to create forms or should I say, everything...
3
3110
by: Waqas Pitafi | last post by:
Hi, I have a table with the data like this, ID Status Description 1 R Read 2 U UnRead D D ...
2
5255
by: phpuser32423 | last post by:
Hi everyone Is it by any chance possible to use mysql and php to auto create the content for drop-down lists on forms by retrieving the values from a database? The reason i ask is that on a site...
3
390
by: Waqas Pitafi | last post by:
Hi, I have a table with the data like this, ID Status Description 1 R Read 2 U UnRead D D ...
0
7257
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
7157
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
7379
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
1
7098
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
5682
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
0
4745
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and...
0
3221
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
0
1591
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated ...
0
455
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.