mysql date format  
Author Message
swashi





PostPosted: Sat Apr 16 00:14:00 CDT 2005 Top

Visual Basic [VB] >> mysql date format 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.

Visual Studio115  
 
 
Adam





PostPosted: Sat Apr 16 00:14:00 CDT 2005 Top

Visual Basic [VB] >> mysql date format 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.
 
 
Woo





PostPosted: Sat Apr 16 07:33:01 CDT 2005 Top

Visual Basic [VB] >> mysql date format 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.


"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.
>
 
 
Adam





PostPosted: Sun Apr 17 05:52:06 CDT 2005 Top

Visual Basic [VB] >> mysql date format When Reader.GetString() fails, what exception does it throw?

Regards,
-Adam.

Woo wrote:
> 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.
>
 
 
Woo





PostPosted: Mon Apr 18 21:06:01 CDT 2005 Top

Visual Basic [VB] >> mysql date format Hi, found out that the reader is used twice and it was giving the previous
search info. changed to a new reader and the problem resolved. thanks. but
funny thing is that the reader has been closed, dbconnect also closed. after
that only the reader is reopen n search again n this problem happened. hence
i have no choice but to change by creating a new reader.

thanks for your help.

"Adam Goossens" wrote:

> When Reader.GetString() fails, what exception does it throw?
>
> Regards,
> -Adam.
>
> Woo wrote:
> > 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.
> >
>