2 messages in com.mysql.lists.dotnetUnable to convert MySQL date/time val...
FromSent OnAttachments
Jesse Castleberry10 Nov 2005 13:55 
Linde, Thomas28 Nov 2005 05:09 
Subject:Unable to convert MySQL date/time value to System.DateTime
From:Jesse Castleberry (Jes@msdlg.com)
Date:11/10/2005 01:55:28 PM
List:com.mysql.lists.dotnet

I'm converting an ASP.Net app over from using MS SQL Server to MySQL. I used the following line to detect a null date field:

if not IsDBNull(RS("CampStartDate")) then CampStartDate.Text = FormatDateTime(Convert.ToDateTime(RS("CampStartDate")),DateFormat.ShortDate)

However, when I execute this line with MySQL database, I get the error, "Unable to convert MySQL date/time value to System.DateTime". I found on the net that if I include "Allow Zero Datetime=true" in my connection string it will take care of it, and it appears to have done so. However, when it attempts to execute the next line, I get the same exact error. I have tried converting this field from DateTime to just Date, because I do not need a time element, and that hasn't made any difference.

Anyone know how to overcome this?

Thanks, Jesse