Hi,

Interrogating the DataType property of a DataColumn object where the
underlying column in a mySQL table is CHAR, VARCHAR or TEXT returns
System.String for each. Is there a method to differentiate these underlying
datatypes and, if so, to interrogate the column length so that it will
return me, say, VARCHAR(20) instead of just System.String?

Any assistance gratefully received.

Best regards,

Mark Rae

Re: Interrogating mySQL datatypes with ADO.NET by Sahil

Sahil
Mon Dec 06 09:01:26 CST 2004

What is the data provider you are using?

- Sahil Malik
http://dotnetjunkies.com/weblog/sahilmalik
http://blogs.apress.com/authors.php?author=Sahil Malik



"Mark Rae" <mark@mark-N-O-S-P-A-M-rae.co.uk> wrote in message
news:#gs3#o32EHA.2600@TK2MSFTNGP09.phx.gbl...
> Hi,
>
> Interrogating the DataType property of a DataColumn object where the
> underlying column in a mySQL table is CHAR, VARCHAR or TEXT returns
> System.String for each. Is there a method to differentiate these
underlying
> datatypes and, if so, to interrogate the column length so that it will
> return me, say, VARCHAR(20) instead of just System.String?
>
> Any assistance gratefully received.
>
> Best regards,
>
> Mark Rae
>
>



Re: Interrogating mySQL datatypes with ADO.NET by tnsrbdqs

tnsrbdqs
Mon Dec 06 09:04:34 CST 2004

http://www.ardice.com/Computers/Programming/Databases/ADO/


Re: Interrogating mySQL datatypes with ADO.NET by rcheyelo


Re: Interrogating mySQL datatypes with ADO.NET by Mark

Mark
Mon Dec 06 12:11:33 CST 2004

"Sahil Malik" <contactmethrumyblog@nospam.com> wrote in message
news:%23ZoK1R62EHA.3596@TK2MSFTNGP12.phx.gbl...

> What is the data provider you are using?

Core Lab MySQLDirect .NET Data Provider 2.30



Re: Interrogating mySQL datatypes with ADO.NET by Sahil

Sahil
Mon Dec 06 13:30:44 CST 2004

I am not a MySql expert, but seems like this level of detail isn't built
into the provider you are using. You could verify that by decompiling it
using reflector. Worst case, you might want to write up your own schema
query mechanisms.

- Sahil Malik
http://dotnetjunkies.com/weblog/sahilmalik





"Mark Rae" <mark@mark-N-O-S-P-A-M-rae.co.uk> wrote in message
news:ezgzH872EHA.2156@TK2MSFTNGP10.phx.gbl...
> "Sahil Malik" <contactmethrumyblog@nospam.com> wrote in message
> news:%23ZoK1R62EHA.3596@TK2MSFTNGP12.phx.gbl...
>
> > What is the data provider you are using?
>
> Core Lab MySQLDirect .NET Data Provider 2.30
>
>



Re: Interrogating mySQL datatypes with ADO.NET by Frans

Frans
Mon Dec 06 14:23:59 CST 2004

Mark Rae wrote:
> "Sahil Malik" <contactmethrumyblog@nospam.com> wrote in message
> news:%23ZoK1R62EHA.3596@TK2MSFTNGP12.phx.gbl...
>
>
>>What is the data provider you are using?
>
>
> Core Lab MySQLDirect .NET Data Provider 2.30

That's an oldie :) They're at 2.70.1 at the moment.

To answer your original question, no, once the db type is converted to
the .net type, you're stuck with the .NET type, as the db type is not
that interesting (in theory).

If you want to know the db type, you can always use the describe table
command of mysql, or use the trick with the command builder (create a
command using the command builder object, and check which type is
created for the parameters for the various fields)

Frans.

--
Get LLBLGen Pro, productive O/R mapping for .NET: http://www.llblgen.com
My .NET Blog : http://weblogs.asp.net/FBouma
Microsoft MVP (C#)

Re: Interrogating mySQL datatypes with ADO.NET by Mark

Mark
Mon Dec 06 15:08:56 CST 2004

"Frans Bouma [C# MVP]" <perseus.usenetNOSPAM@xs4all.nl> wrote in message
news:uM8ARG92EHA.3388@TK2MSFTNGP15.phx.gbl...

>> Core Lab MySQLDirect .NET Data Provider 2.30
>
> That's an oldie :) They're at 2.70.1 at the moment.
>
> To answer your original question, no, once the db type is converted to the
> .net type, you're stuck with the .NET type, as the db type is not that
> interesting (in theory).
>
> If you want to know the db type, you can always use the describe table
> command of mysql, or use the trick with the command builder (create a
> command using the command builder object, and check which type is created
> for the parameters for the various fields)

OK - thanks.



Re: Interrogating mySQL datatypes with ADO.NET by Mark

Mark
Mon Dec 06 15:12:43 CST 2004

"Sahil Malik" <contactmethrumyblog@nospam.com> wrote in message
news:%23FiAUo82EHA.3336@TK2MSFTNGP11.phx.gbl...

> Worst case, you might want to write up your own schema query mechanisms.

LOL!