Home All Groups Group Topic Archive Search About
Author
16 Apr 2005 4:05 AM
Woo
hi, anyone know how to retrieve date from mysql database? i am using odbc
connection. which reader.getXXX shall I use? for example, my date in mysql is
2005-04-01. i have tried using reader.getstring, reader.getdate but all still
fail. If I use a getstring, it return "dd". (funny). using getdate returns
runtime error.
thanks in advance.

Author
16 Apr 2005 5:14 AM
Adam Goossens
Hi,

If that fails, try a simple Reader.GetValue() and do a cast to DateTime
from VB.NET code.

Or, use the official MySQL .NET provider (which involves no ODBC and is
very fast).

Regards,
-Adam.

Woo wrote:
Show quoteHide quote
> hi, anyone know how to retrieve date from mysql database? i am using odbc
> connection. which reader.getXXX shall I use? for example, my date in mysql is
> 2005-04-01. i have tried using reader.getstring, reader.getdate but all still
> fail. If I use a getstring, it return "dd". (funny). using getdate returns
> runtime error.
> thanks in advance.
Author
16 Apr 2005 12:33 PM
Woo
Hi, Adam.

Thanks for the info on getvalue. But the result from it was a string field
value of "dd". Not "2004-04-16".

I am not using ADO as I am using DSN to perform database connection. this is
to enable the user to switch database easily by just switching the server in
DSN. Hope to hear any suggestion/solution.


Show quoteHide quote
"Adam Goossens" wrote:

> Hi,
>
> If that fails, try a simple Reader.GetValue() and do a cast to DateTime
> from VB.NET code.
>
> Or, use the official MySQL .NET provider (which involves no ODBC and is
> very fast).
>
> Regards,
> -Adam.
>
> Woo wrote:
> > hi, anyone know how to retrieve date from mysql database? i am using odbc
> > connection. which reader.getXXX shall I use? for example, my date in mysql is
> > 2005-04-01. i have tried using reader.getstring, reader.getdate but all still
> > fail. If I use a getstring, it return "dd". (funny). using getdate returns
> > runtime error.
> > thanks in advance.
>
Author
17 Apr 2005 10:52 AM
Adam Goossens
When Reader.GetString() fails, what exception does it throw?

Regards,
-Adam.

Woo wrote:
Show quoteHide quote
> Hi, Adam.
>
> Thanks for the info on getvalue. But the result from it was a string field
> value of "dd". Not "2004-04-16".
>
> I am not using ADO as I am using DSN to perform database connection. this is
> to enable the user to switch database easily by just switching the server in
> DSN. Hope to hear any suggestion/solution.
>