Page 1 of 1

Info about columns

Posted: Thu 07 Jun 2007 14:01
by kaspertsw
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.

One workaround...

Posted: 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

Posted: Sun 10 Jun 2007 13:34
by kaspertsw
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? :)

Posted: Mon 11 Jun 2007 15:45
by Alexey
Unfortunately, currently there is no possibility for you to see MySQL datatype.