List:MySQL and .NET« Previous Message
From:Reggie Burnett Date:November 16 2004 5:32pm
Subject:RE: 1.0.2
View as plain text  
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