Unable to convert MySQL date/time value to System.DateTime
Adding "convert zero datetime=True" to the connection string solved my problem.
<connectionStrings> <add name="MyContext" connectionString="Datasource=localhost;Database=MyAppDb;Uid=root;Pwd=root;CHARSET=utf8;convert zero datetime=True" providerName="MySql.Data.MySqlClient" /> </connectionStrings>
Regards PS
MySqlConnection connect = new MySqlConnection("server=localhost; database=luttop; user=root; password=1234; pooling = false; convert zero datetime=True");
Adding convert zero datetime=True
to the connection string will automatically convert 0000-00-00
Date values to DateTime.MinValue()
.
that's SOLVED