Skip to content

Commit

Permalink
Add better exception message when 0000-00-00 can't be converted mysql…
Browse files Browse the repository at this point in the history
…-net#690

Signed-off-by: Roma Marusyk <romamarusyk@gmail.com>
  • Loading branch information
Marusyk committed Oct 3, 2019
1 parent 9b8f3a4 commit 1e74dbc
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/MySqlConnector/Core/TextRow.cs
Expand Up @@ -145,7 +145,7 @@ private object ParseDateTime(ReadOnlySpan<byte> value)
return DateTime.MinValue;
if (Connection.AllowZeroDateTime)
return new MySqlDateTime();
throw new InvalidCastException("Unable to convert MySQL date/time to System.DateTime.");
throw new InvalidCastException("Unable to convert MySQL date/time to System.DateTime, set AllowZeroDateTime=True or ConvertZeroDateTime=True in the connection string. See https://mysqlconnector.net/connection-options/");
}

int hour, minute, second, microseconds;
Expand Down

0 comments on commit 1e74dbc

Please sign in to comment.