|
web
newsgroups
|
|||||||||||||||||||||||
|
|||||||||||||||||||||||
mysql date formathi, 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. 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. 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. > 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. >
Determine if "Hide extensions for known file types" is active
Need help updating table What scope is best for defining Enum type? VB6 to VB.Net Conversion How to overload method of third party component? Selecting specific columns from a dataview? Limiting the directories somebody can browse to..... StringBuilder size question? Simple Reflection Question countdown timer |
|||||||||||||||||||||||