Home All Groups Group Topic Archive Search About

Extracting enum from table

Author
1 Apr 2005 2:32 PM
Morten Skov via .NET 247
Hi,

I'm reading the result of a query using MySqlDataReader. I'd like to extract information about the row datatypes that are returned. For example, myDataReader.GetFieldType(1).TosTring() will easily return values such as "System.UInt32" or "System.Byte".

My problem is that i'd like to retrieve information about enum types. 
My datatype in the MySQL db is defined as: ENUM('red','blue','orange') but the above code will return "System.String".
I'm interested in retrieving something that will give me all valid input types for an enum field in the database.

I've also tried looking at the System.Data.DataTable object but didn't find any clues on how to solve this.
Any help is greatly appreciated.



--------------------------------
From: Morten Skov

-----------------------
Posted by a user from .NET 247 (http://www.dotnet247.com/)

<Id>ltesbJ0arEScu0cv8VUUKQ==</Id>

AddThis Social Bookmark Button