Link to home
Start Free TrialLog in
Avatar of csetzkorn
csetzkorn

asked on

ADO.NET DataColumn enumeration

Dear all,

Let us assume that one of my MySQL tables has an enum column, defined as follows:


status ENUM( 'open', 'accepted', 'rejected' ) NOT NULL


I would like to define a DataColumn in my DataTable that matches this type. Unfortunately, a DataColumn cannot be of type ‘enumeration’. How am I going about this? How can I match this MySQL data type?

Many thanks in advance.

Best wishes,

Christian
Avatar of Bob Learned
Bob Learned
Flag of United States of America image

VarChar (8)?

Bob
Avatar of csetzkorn
csetzkorn

ASKER

VarChar(8)

Sure, but I would like to make it more strongly typed, to enforce that the value can only be 'open', 'accepted', 'rejected'.

BTW could someone recomend a good book, tutorial etc. on ADO.NET? I am a bit confused that I have to replicate the whole structure of the database structure in the DataSet object in order to update etc. I know that this has advantages, because the DataSet object can exist independently from the database.

Christian
ASKER CERTIFIED SOLUTION
Avatar of Bob Learned
Bob Learned
Flag of United States of America image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
SOLUTION
Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial