Info about columns

Info about columns

Postby 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.
kaspertsw
 
Posts: 2
Joined: Thu 07 Jun 2007 13:56

One workaround...

Postby john@haldi.net » 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
john@haldi.net
 
Posts: 38
Joined: Tue 07 Mar 2006 17:13

Postby 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? :)
kaspertsw
 
Posts: 2
Joined: Thu 07 Jun 2007 13:56

Postby Alexey » Mon 11 Jun 2007 15:45

Unfortunately, currently there is no possibility for you to see MySQL datatype.
Alexey
 
Posts: 2756
Joined: Mon 13 Mar 2006 07:43


Return to dotConnect for MySQL