System.Data.SqlClient.SqlException Conversion failed when converting date and / or time from character string

0

Live Personal,

I'm new to the .NET world, C #, EntityFramework (Microsoft world). I am working on a project with the mentioned technologies, initially I was programming in a VM (with Windows) because I use MAC but I had some performance problems and decided to abandon the VM and also because it already exists support for MAC .

I was able to make the settings and the application runs smoothly, except when I have to deal with fields of type DateTime , either by persisting in the base or just reading. Down the stacktrace. Note: I'm using SQLServer with Docker

System.Data.SqlClient.SqlException
Conversion failed when converting date and/or time from character string.

Description: HTTP 500.Error processing request.
Details: Non-web exception. Exception origin (name of application or object): .Net SqlClient Data Provider.
Exception stack trace:
  at System.Data.SqlClient.SqlConnection.ErrorHandler (System.Object sender, Mono.Data.Tds.Protocol.TdsInternalErrorMessageEventArgs e) [0x00023] in /Users/builder/data/lanes/4992/mono-mac-sdk/external/bockbuild/builds/mono-x64/mcs/class/System.Data/System.Data.SqlClient/SqlConnection.cs:294 
  at Mono.Data.Tds.Protocol.Tds.OnTdsErrorMessage (Mono.Data.Tds.Protocol.TdsInternalErrorMessageEventArgs e) [0x00008] in /Users/builder/data/lanes/4992/mono-mac-sdk/external/bockbuild/builds/mono-x64/mcs/class/Mono.Data.Tds/Mono.Data.Tds.Protocol/Tds.cs:1681 
  at Mono.Data.Tds.Protocol.Tds.ProcessMessage (Mono.Data.Tds.Protocol.TdsPacketSubType subType) [0x000e6] in /Users/builder/data/lanes/4992/mono-mac-sdk/external/bockbuild/builds/mono-x64/mcs/class/Mono.Data.Tds/Mono.Data.Tds.Protocol/Tds.cs:1721 
  at Mono.Data.Tds.Protocol.Tds.ProcessSubPacket () [0x00134] in /Users/builder/data/lanes/4992/mono-mac-sdk/external/bockbuild/builds/mono-x64/mcs/class/Mono.Data.Tds/Mono.Data.Tds.Protocol/Tds.cs:1773 
  at Mono.Data.Tds.Protocol.Tds.NextResult () [0x00039] in /Users/builder/data/lanes/4992/mono-mac-sdk/external/bockbuild/builds/mono-x64/mcs/class/Mono.Data.Tds/Mono.Data.Tds.Protocol/Tds.cs:625 
  at System.Data.SqlClient.SqlDataReader.NextResult () [0x00036] in /Users/builder/data/lanes/4992/mono-mac-sdk/external/bockbuild/builds/mono-x64/mcs/class/System.Data/System.Data.SqlClient/SqlDataReader.cs:1320 
  at System.Data.SqlClient.SqlDataReader..ctor (System.Data.SqlClient.SqlCommand command) [0x00019] in /Users/builder/data/lanes/4992/mono-mac-sdk/external/bockbuild/builds/mono-x64/mcs/class/System.Data/System.Data.SqlClient/SqlDataReader.cs:109 
  at (wrapper remoting-invoke-with-check) System.Data.SqlClient.SqlDataReader:.ctor (System.Data.SqlClient.SqlCommand)
  at System.Data.SqlClient.SqlCommand.ExecuteReader (System.Data.CommandBehavior behavior) [0x00068] in /Users/builder/data/lanes/4992/mono-mac-sdk/external/bockbuild/builds/mono-x64/mcs/class/System.Data/System.Data.SqlClient/SqlCommand.cs:509 
  at System.Data.SqlClient.SqlCommand.ExecuteDbDataReader (System.Data.CommandBehavior behavior) [0x00000] in /Users/builder/data/lanes/4992/mono-mac-sdk/external/bockbuild/builds/mono-x64/mcs/class/System.Data/System.Data.SqlClient/SqlCommand.cs:764 
  at System.Data.Common.DbCommand.ExecuteReader (System.Data.CommandBehavior behavior) [0x00000] in /Users/builder/data/lanes/4992/mono-mac-sdk/external/bockbuild/builds/mono-x64/external/corefx/src/System.Data.Common/src/System/Data/Common/DbCommand.cs:114 
  at (wrapper remoting-invoke-with-check) System.Data.Common.DbCommand:ExecuteReader (System.Data.CommandBehavior)
  at System.Data.Entity.Infrastructure.Interception.DbCommandDispatcher.<Reader>b__c (System.Data.Common.DbCommand t, System.Data.Entity.Infrastructure.Interception.DbCommandInterceptionContext'1[TResult] c) [0x00007] in <5a182091cae84952ac9bbf3418cefa24>:0 
  at System.Data.Entity.Infrastructure.Interception.InternalDispatcher'1[TInterceptor].Dispatch[TTarget,TInterceptionContext,TResult] (TTarget target, System.Func'3[T1,T2,TResult] operation, TInterceptionContext interceptionContext, System.Action'3[T1,T2,T3] executing, System.Action'3[T1,T2,T3] executed) [0x000f1] in <5a182091cae84952ac9bbf3418cefa24>:0 
  at System.Data.Entity.Infrastructure.Interception.DbCommandDispatcher.Reader (System.Data.Common.DbCommand command, System.Data.Entity.Infrastructure.Interception.DbCommandInterceptionContext interceptionContext) [0x00042] in <5a182091cae84952ac9bbf3418cefa24>:0 
  at System.Data.Entity.Internal.InterceptableDbCommand.ExecuteDbDataReader (System.Data.CommandBehavior behavior) [0x00046] in <5a182091cae84952ac9bbf3418cefa24>:0 
  at System.Data.Common.DbCommand.ExecuteReader (System.Data.CommandBehavior behavior) [0x00000] in /Users/builder/data/lanes/4992/mono-mac-sdk/external/bockbuild/builds/mono-x64/external/corefx/src/System.Data.Common/src/System/Data/Common/DbCommand.cs:114 
  at (wrapper remoting-invoke-with-check) System.Data.Common.DbCommand:ExecuteReader (System.Data.CommandBehavior)
  at System.Data.Entity.Core.Mapping.Update.Internal.DynamicUpdateCommand.Execute (System.Collections.Generic.Dictionary'2[TKey,TValue] identifierValues, System.Collections.Generic.List'1[T] generatedValues) [0x0007e] in <5a182091cae84952ac9bbf3418cefa24>:0 
  at System.Data.Entity.Core.Mapping.Update.Internal.UpdateTranslator.Update () [0x0002b] in <5a182091cae84952ac9bbf3418cefa24>:0
    
asked by anonymous 21.02.2018 / 16:13

0 answers