Bug #46874 Error in converting DateTime from DB at DataReader of connector.
Submitted: 24 Aug 2009 2:16 Modified: 24 Aug 2009 6:22
Reporter: voluong vonga Email Updates:
Status: Not a Bug Impact on me:
Category:Connector / NET Severity:S1 (Critical)
Version:6.0.4 OS:Microsoft Windows (Xp SP2)
Assigned to: CPU Architecture:Any

[24 Aug 2009 2:16] voluong vonga
Under Dot-net-framework 2.0, i use mysql-connector-net6.0.4, when making a query to db-mysql, to retrieve data that contains data-type is DateTime, it throw an exception about converting

Using class: MySql.Data.MySqlClient.MySqlDataReader

------ Error Content -----
Unable to convert MySQL date/time value to System.DateTime

How to repeat:
[24 Aug 2009 2:42] voluong vonga
Ah, one more item,

Data of DateTime field is null in DB.
[24 Aug 2009 6:22] Tonci Grgin
Hi Voluong and thanks for your report.

Now, it would be nice if you have attached full test case so I don't have to guess... Since there is none, I'd say problem is in that you have not defined the way c/NET will deal with dates outside .NET specs. Please see c/NET documentation on "Allow Zero Datetime" connection parameter.