Re: Any resolution for MySqlDbType.Datetime?
Posted by: Umberto Ballestrazzi
Date: December 09, 2004 02:43PM

I think it's a bug (IMHO data type handling is not so good in this new release).

Try this:

in datareader.cs search for this lines
// if the column is a date/time, then we return a MySqlDateTime
// so .ToString() will print '0000-00-00' correctly
if (val is MySqlDateTime) return val;

and replace the 'return val;' with
if (((MySqlDateTime) val).IsNull)
return DBNull.Value;
return ((MySqlDateTime) val).GetDateTime();

Options: ReplyQuote

Sorry, you can't reply to this topic. It has been closed.

Content reproduced on this site is the property of the respective copyright holders. It is not reviewed in advance by Oracle and does not necessarily represent the opinion of Oracle or any other party.