How do I use enumerations with an inherited property

All your dOOdad needs ...

How do I use enumerations with an inherited property

Postby PAPutzback on Fri Apr 06, 2007 3:49 pm

I have a field called membertype and I only want the user to be able to select from the enumerations.

Public Enum MemberTypes As Integer
Subscriber = 1
Patient = 2
SubAndPatient = 3
End Enum

Public Overrides Property MemType() As Integer
Get
Return MyBase.MemType
End Get
Set(ByVal value As Integer)
MyBase.MemType = value
End Set
End Property

So when the user goes to set the value they only see the 3 options. Is this possible?

Thanks,
Phil
PAPutzback
Staff Sergent
 
Posts: 39
Joined: Tue Jan 31, 2006 6:20 pm

Postby dnparsons on Sun Apr 08, 2007 8:51 am

Most databases do not have an ENUM column data type (MySQL being the notable exception.) The solution is to create a MemberType table and a foreign key constraint.
David Neal Parsons
EntitySpaces
User avatar
dnparsons
Lieutenant General
 
Posts: 292
Joined: Sun Jan 09, 2005 2:10 pm
Location: Miami, Florida


Return to dOOdads - MyGeneration's .NET Architecture

Who is online

Users browsing this forum: No registered users and 2 guests