0
Fix “Unable to convert MySQL date/time value to System.DateTime” exception when using MySQL .NET Connector
Recently I developed a WPF MVVM application using MySQL as database. I faced a lot of problems!
One Issues i faced was when i retrieve the data from data base using linq i am getting exception "Unable to convert MySQL date/time value to System.DateTime". When i checked the data has empty /0000-00-00 as date. When i checked in the internet i found the solution.
Fix one Change or fix the Dates to a correct date.
Fix Two
add the following property to connection string
convert zero datetime=True;
You can set this when you connect to the data base as well. You have to click advanced and make the "convert zero datetime" property true;
One Issues i faced was when i retrieve the data from data base using linq i am getting exception "Unable to convert MySQL date/time value to System.DateTime". When i checked the data has empty /0000-00-00 as date. When i checked in the internet i found the solution.
Fix one Change or fix the Dates to a correct date.
Fix Two
add the following property to connection string
convert zero datetime=True;
You can set this when you connect to the data base as well. You have to click advanced and make the "convert zero datetime" property true;
Post a Comment