VB.Net mysql.data.dll Connector/Net Exception Unable to convert MySQL date/time value to System.DateTime

今日有朋友在VB.Net 上使用 MySQL 的 ADO.NET driver for MySQL [mysql.data.dll ]..時候 出現了以下的錯誤句子
“Unable to convert MySQL date/time value to System.DateTime”

只要在Connection String 上加入以下設定便可
Allow Zero Datetime=True

更改了的Connection String 是這樣子的
Dim cs as String = “Database=TestDataBaseName; Data Source=localhost;User Id=root;Password=password; Allow Zero Datetime=True;”

Hope you find it useful

Leave a Reply

This site uses Akismet to reduce spam. Learn how your comment data is processed.