E
Ernie
I have enums in a .cs class that have Ids which I manually match to
correspond with PKs (primary keys) that exist in an "Admin" database
table. Right now I just make sure the enum Ids match the corresponding
PKs. Is there a way to bind an enum to a dataset so that on
application load the enums are filled with database values and not my
hard-coded values. This way I don't have to edit the enums is the PKs
ever change and if rows are added/deleted.
I realize that enums are really constants that are compiled into the
dll, but know that others must have come across this same issue.
I just want something non-manual. Many thanks for any help.
C#
-------------------------------------------------------------
public enum AdminType //must match database PKs for each item
{
TGH = 5,
TWH,
Corporate,
Master
}
Admins database table
correspond with PKs (primary keys) that exist in an "Admin" database
table. Right now I just make sure the enum Ids match the corresponding
PKs. Is there a way to bind an enum to a dataset so that on
application load the enums are filled with database values and not my
hard-coded values. This way I don't have to edit the enums is the PKs
ever change and if rows are added/deleted.
I realize that enums are really constants that are compiled into the
dll, but know that others must have come across this same issue.
I just want something non-manual. Many thanks for any help.
C#
-------------------------------------------------------------
public enum AdminType //must match database PKs for each item
{
TGH = 5,
TWH,
Corporate,
Master
}
Admins database table