Bug #53254 | MySqlDateTime - GetDateTime - throws exception | ||
---|---|---|---|
Submitted: | 28 Apr 2010 15:05 | Modified: | 29 Apr 2010 17:28 |
Reporter: | blabla ballalsj | Email Updates: | |
Status: | Closed | Impact on me: | |
Category: | Connector / NET | Severity: | S1 (Critical) |
Version: | 6.3.1 | OS: | Windows (7) |
Assigned to: | CPU Architecture: | Any |
[28 Apr 2010 15:05]
blabla ballalsj
[29 Apr 2010 5:29]
Tonci Grgin
Hi Sirrocco and thanks for your report. Please *please* do not use me to read manual instead of you... So, do take a look into http://dev.mysql.com/doc/refman/5.1/en/connector-net-connection-options.html and correct the values of "Allow Zero Datetime" and "Convert Zero Datetime" to suite your needs. System.DateTime cannot represent zero datetime values. MySqlDateTime does support zero datetime values (for legacy reasons). Allow Zero Datetime = False - Zero datetime values are not allowed. - Exception is thrown for illegal values (presumably that includes zero datetime values). Allow Zero Datetime = True - MySqlReader.GetValue() returns a MySqlDateTime for illegal values. The intention is to return a DateTime in every case that the value is legal and MySqlDateTime in other cases.
[29 Apr 2010 17:28]
blabla ballalsj
Hi Tonci I'm very sorry for this, I did search for a solution to the problem and I had only found "Allow Zero Datetime" and that didn't work. I tried "Convert Zero Datetime" and it did the trick. Again, I'm very sorry for wasting your time. Thanks.