i have the code in c#
string date = reader["date"].ToString();
and got error that
Unable to convert MySQL date/time value to System.DateTime
when i convert them to string then why it’s trying to convert them to datetime. well the value they create error is 0000-00-00 00:00:00
Because
0000-00-00 00:00:00is not valid .Net DateTime (minimum value is 00:00:00.0000000, January 1, 0001)Add this to the connection string :
Allow Zero Datetime=trueandConvert Zero Datetime=true