Dynamic Enum

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

Hi All

Is there any way to create the Enum dynamically from database table.

Thank
Chowdary D
 
Tells us what your up to Chowdary.... you can pretty much create anythig
dynamically through reflection, although whether its the best approach is
always another question.

System.Reflection.Emit


hth
Richard
 
I am actually trying to do something very similar. In my case I have an
enum that looks like:

Protected Enum serviceEnum

UNDEFINED

LOGIN

TIME

INDEX

End Enum


I need to make it more dynamic and read the values from an XML file. The
XML file structure will look something like:
<?xml version="1.0" encoding="utf-8" ?>

<company id="ABC">

<serviceIDS>

<serviceID>UNDEFINED</serviceID>

<serviceID>LOGIN</serviceID>

<serviceID>TIME</serviceID>

<serviceID>INDEX</serviceID>

</serviceIDS>

</company>
 
Back
Top