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
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
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
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
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Bob