List:MySQL and .NET« Previous MessageNext Message »
From:Barry Zubel Date:November 17 2004 9:42am
Subject:RE: 1.0.2
View as plain text  
Well, using CDate(row("UPDATED")) and also CType(row("UPDATED"), DateTime)
throws an invalid cast exception.

I've managed to circumvent for the moment by using
CDate(row("UPDATED").ToString) which does appear to work, although I'll need
to run some more tests with my app to see if it breaks anything else :D

Thanks for continuing progress on the connector though, Reggie - here's
looking forward to a GA release sometime before Christmas :D

B.


-----Original Message-----
From: Reggie Burnett [mailto:reggie@stripped] 
Sent: 16 November 2004 17:32
To: 'Barry Zubel'; dotnet@stripped
Subject: RE: 1.0.2


Barry

Dates are real pain the butt with the connector and MySQL.  You didn't break
anything.  Add a DateTime cast in front of row("UPDATED").

The problem is that MySQL supports illegal dates and I'm trying to fully
support that too.  If I have a date of '0000-01-01' in MySQL, then I want
Row("updated").ToString() to print "0000-01-01" or at least 01/01/0000 since
this is what the user wanted.

However, I can't do this with a normal DateTime object.  To support this, I
am returning a MySqlDateTime for date and datetime fields.  MySqlDateTime
has a conversion operator to convert to a DateTime (if possible).

-reggie

> -----Original Message-----
> From: Barry Zubel [mailto:barry@stripped]
> Sent: Tuesday, November 16, 2004 11:25 AM
> To: dotnet@stripped
> Subject: 1.0.2
> 
> Dates conversion doesn't appear to be casting correctly?
> 
> Cust.Updated = row("UPDATED") throws an InvalidCastException
> 
> Cust.Updated is a VB 'Date' variable
> Row("UPDATED") is a MySql 'Date' Field
> 
> Any ideas what I broke? :D
> 
> B.
> 
> 
> --
> MySQL on .NET Mailing List
> For list archives: http://lists.mysql.com/dotnet
> To unsubscribe:    http://lists.mysql.com/dotnet?unsub=1

Thread
1.0.2Barry Zubel16 Nov
  • RE: 1.0.2Barry Zubel16 Nov
  • RE: 1.0.2Reggie Burnett16 Nov
    • RE: 1.0.2Barry Zubel17 Nov