Info about columns

Discussion of open issues, suggestions and bugs regarding ADO.NET provider for MySQL
Post Reply
kaspertsw
Posts: 2
Joined: Thu 07 Jun 2007 13:56

Info about columns

Post by kaspertsw » Thu 07 Jun 2007 14:01

Hello,

In my application, I would like the same set of features as in the "DbTable" sample app. It seems to work fine. However, I would like to get some more information about each column of the table in question. I seem to be able to find the name and length of each column, through Caption and MaxLength on the DataColumn objects in the mySqlDataTable.Columns collection, but I need at least one more piece of information: The datatype of the column. There is a DataType property, but that only gives me the .NET type (I guess), which is irrelevant for my users. How do I get the real MySQL datatype for the column?

Thanks in advance.

[email protected]
Posts: 38
Joined: Tue 07 Mar 2006 17:13

One workaround...

Post by [email protected] » Thu 07 Jun 2007 15:23

I needed the get at something similar as well. This may be a seemingly dumb workaround to some, but rather than trying to sift through any translation that .NET might do via the table adapter, I wrote a simple utility class which issues a "SHOW COLUMNS FROM table_name" command to the MySQL server and then grabs the relevant rows/columns from the table that is returned from this query and presents it back to my app for use.

Just an idea...

John

kaspertsw
Posts: 2
Joined: Thu 07 Jun 2007 13:56

Post by kaspertsw » Sun 10 Jun 2007 13:34

Thank you for the suggestion John, but I was thinking that since this must be a common need, the controls would have a more clean way of doing this? Could we get a word from the author of the controls? :)

Alexey
Posts: 2756
Joined: Mon 13 Mar 2006 07:43

Post by Alexey » Mon 11 Jun 2007 15:45

Unfortunately, currently there is no possibility for you to see MySQL datatype.

Post Reply