List:MySQL and .NET« Previous MessageNext Message »
From:Reggie Burnett Date:November 18 2004 4:52am
Subject:RE: Installer & MySqlDateTime
View as plain text  
It's not quite that easy.  Consider a heterogenous environment where zero
datetimes are being inserted by other tools.  Then consider the data adapter
trying to do updates against this table.  One option is to have the
connector always throw an exception when it encounters an illegal datetime.
This doesn't play well with the other tools.

The other option is to just return null or datetime.minvalue when an illegal
value is found.  The problem with this is when an update then needs to
occur.  If LastOneWins is not selected, then the commandbuilder will
construct an update command that uses values of the columns to check if
they've changed.  If we are using null or datetime.minvalue, then the
illegal datetime columns will never match and the update will not occur on
those rows.

Everyone, please continue the discussion on this as it helps me to listen to
other points of view.  

-reggie

> -----Original Message-----
> From: Joshua Mouch [mailto:joshua@stripped]
> Sent: Wednesday, November 17, 2004 9:23 PM
> To: 'James Moore'; dotnet@stripped
> Subject: RE: Installer & MySqlDateTime
> 
> James,
> 
> I completely agree with this.  I love to write code that is cross-database
> compatible.  As such, the .Net Date object becomes the common denominator,
> as any other connector will return it, allowing for object factories to be
> created.  On top of that I have absolutely no desire to ever use illegal
> dates.  ;-)
> 
> Joshua Mouch
> EmailScout Support Team
> http://www.emailscout.net
> 
> 
> -----Original Message-----
> From: James Moore [mailto:banshee@stripped]
> Sent: Wednesday, November 17, 2004 7:02 PM
> To: SGreen@stripped; 'Joshua Mouch'
> Cc: dotnet@stripped
> Subject: RE: Installer & MySqlDateTime
> 
> This doesn't feel very .Net-like to me, though.
> 
> Think about nullable ints.  Representing them as a C# "int" is incorrect;
> int's in C# can't be set to null.  Rather than choosing a different type
> that would model the database more correctly, the Microsoft adapters
> choose
> to sacrifice correct representation in favor of the thing that mostly, but
> not entirely, does what you want.
> 
> Why not just have the adapter throw an exception when you get an
> legal-in-MySQL-illegal-in-dotNet date?  Or allow the developer to specify
> what you do with those dates.
> 
>  - James
> 
> 
> --
> MySQL on .NET Mailing List
> For list archives: http://lists.mysql.com/dotnet
> To unsubscribe:
> http://lists.mysql.com/dotnet?unsub=1
> 
> 
> --
> MySQL on .NET Mailing List
> For list archives: http://lists.mysql.com/dotnet
> To unsubscribe:    http://lists.mysql.com/dotnet?unsub=1

Thread
Installer & MySqlDateTimeJoshua Mouch17 Nov
  • Re: Installer & MySqlDateTimeSGreen17 Nov
    • RE: Installer & MySqlDateTimeReggie Burnett17 Nov
      • RE: Installer & MySqlDateTimeSGreen18 Nov
    • RE: Installer & MySqlDateTimeJames Moore18 Nov
      • RE: Installer & MySqlDateTimeJoshua Mouch18 Nov
        • RE: Installer & MySqlDateTimeReggie Burnett18 Nov
          • RE: Installer & MySqlDateTimeJames Moore18 Nov
      • RE: Installer & MySqlDateTimeReggie Burnett18 Nov