Since the new release of mysql connector I receive the following error because I have date with format not compatible with .net.
I have the convert zero datetime=true to my connexion string.
server=localhost;userid=xxx;pwd=yyy;port=zzz;database=test;sslmode=none;convert zero datetime=true;allow user variables=true;
I don't understand why the configuration is not working and how I can fix this.
---
MySql.Data.Types.MySqlConversionException
Unable to convert MySQL date/time value to System.DateTime
MySql.Data.Types.MySqlConversionException: Unable to convert MySQL date/time value to System.DateTime
at MySql.Data.Types.MySqlDateTime.GetDateTime()
at MySql.Data.EntityFrameworkCore.Storage.Internal.MySQLDataReader.GetDateTime(Int32 ordinal)
at lambda_method(Closure , DbDataReader )
at Microsoft.EntityFrameworkCore.Storage.Internal.TypedRelationalValueBufferFactory.Create(DbDataReader dataReader)
at Microsoft.EntityFrameworkCore.Query.Internal.QueryingEnumerable.Enumerator.BufferlessMoveNext(Boolean buffer)
at Microsoft.EntityFrameworkCore.Query.QueryMethodProvider.<_ShapedQuery>d__3`1.MoveNext()
at Microsoft.EntityFrameworkCore.Query.Internal.LinqOperatorProvider.<_TrackEntities>d__15`2.MoveNext()
at Microsoft.EntityFrameworkCore.Query.Internal.LinqOperatorProvider.ExceptionInterceptor`1.EnumeratorExceptionInterceptor.MoveNext()
at System.Collections.Generic.List`1..ctor(IEnumerable`1 collection)
at System.Linq.Enumerable.ToList[TSource](IEnumerable`1 source)
at QcRenc.Data.Services.BaseEntityRepository.GetListWithRawSql[TEntity](String query, Object[] parameters) in C:\jbouillon\qcrencontre\src\src\QcRenc.Data\Services\EntityRepository.cs:line 75
I have the convert zero datetime=true to my connexion string.
server=localhost;userid=xxx;pwd=yyy;port=zzz;database=test;sslmode=none;convert zero datetime=true;allow user variables=true;
I don't understand why the configuration is not working and how I can fix this.
---
MySql.Data.Types.MySqlConversionException
Unable to convert MySQL date/time value to System.DateTime
MySql.Data.Types.MySqlConversionException: Unable to convert MySQL date/time value to System.DateTime
at MySql.Data.Types.MySqlDateTime.GetDateTime()
at MySql.Data.EntityFrameworkCore.Storage.Internal.MySQLDataReader.GetDateTime(Int32 ordinal)
at lambda_method(Closure , DbDataReader )
at Microsoft.EntityFrameworkCore.Storage.Internal.TypedRelationalValueBufferFactory.Create(DbDataReader dataReader)
at Microsoft.EntityFrameworkCore.Query.Internal.QueryingEnumerable.Enumerator.BufferlessMoveNext(Boolean buffer)
at Microsoft.EntityFrameworkCore.Query.QueryMethodProvider.<_ShapedQuery>d__3`1.MoveNext()
at Microsoft.EntityFrameworkCore.Query.Internal.LinqOperatorProvider.<_TrackEntities>d__15`2.MoveNext()
at Microsoft.EntityFrameworkCore.Query.Internal.LinqOperatorProvider.ExceptionInterceptor`1.EnumeratorExceptionInterceptor.MoveNext()
at System.Collections.Generic.List`1..ctor(IEnumerable`1 collection)
at System.Linq.Enumerable.ToList[TSource](IEnumerable`1 source)
at QcRenc.Data.Services.BaseEntityRepository.GetListWithRawSql[TEntity](String query, Object[] parameters) in C:\jbouillon\qcrencontre\src\src\QcRenc.Data\Services\EntityRepository.cs:line 75