Server Error in '/' Application.

A .NET Framework error occurred during execution of user-defined routine or aggregate "ToDate":
System.Data.SqlTypes.SqlTypeException: SqlDateTime overflow. Must be between 1/1/1753 12:00:00 AM and 12/31/9999 11:59:59 PM.
System.Data.SqlTypes.SqlTypeException:
  at System.Data.SqlTypes.SqlDateTime.FromTimeSpan(TimeSpan value)
  at System.Data.SqlTypes.SqlDateTime.FromDateTime(DateTime value)
  at TickDates.StoredProcedures.ToDate(SqlInt64 ticks)
.

Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code.

Exception Details: System.Data.SqlClient.SqlException: A .NET Framework error occurred during execution of user-defined routine or aggregate "ToDate":
System.Data.SqlTypes.SqlTypeException: SqlDateTime overflow. Must be between 1/1/1753 12:00:00 AM and 12/31/9999 11:59:59 PM.
System.Data.SqlTypes.SqlTypeException:
  at System.Data.SqlTypes.SqlDateTime.FromTimeSpan(TimeSpan value)
  at System.Data.SqlTypes.SqlDateTime.FromDateTime(DateTime value)
  at TickDates.StoredProcedures.ToDate(SqlInt64 ticks)
.

Source Error:


Line 221:                Throw
Line 222:            Catch eX As SqlException
Line 223:                Throw
Line 224:            Catch eX As System.Exception
Line 225:                Throw

Source File: C:\esdev\VS2019\Rdnzl\Rdnzl\Data\Db.vb    Line: 223

Stack Trace:


[SqlException (0x80131904): A .NET Framework error occurred during execution of user-defined routine or aggregate "ToDate": 
System.Data.SqlTypes.SqlTypeException: SqlDateTime overflow. Must be between 1/1/1753 12:00:00 AM and 12/31/9999 11:59:59 PM.
System.Data.SqlTypes.SqlTypeException: 
   at System.Data.SqlTypes.SqlDateTime.FromTimeSpan(TimeSpan value)
   at System.Data.SqlTypes.SqlDateTime.FromDateTime(DateTime value)
   at TickDates.StoredProcedures.ToDate(SqlInt64 ticks)
.]
   System.Data.SqlClient.SqlConnection.OnError(SqlException exception, Boolean breakConnection, Action`1 wrapCloseInAction) +277
   System.Data.SqlClient.TdsParser.ThrowExceptionAndWarning(TdsParserStateObject stateObj, Boolean callerHasConnectionLock, Boolean asyncClose) +765
   System.Data.SqlClient.TdsParser.TryRun(RunBehavior runBehavior, SqlCommand cmdHandler, SqlDataReader dataStream, BulkCopySimpleResultSet bulkCopyHandler, TdsParserStateObject stateObj, Boolean& dataReady) +4616
   System.Data.SqlClient.SqlDataReader.TryHasMoreRows(Boolean& moreRows) +253
   System.Data.SqlClient.SqlDataReader.TryReadInternal(Boolean setTimeout, Boolean& more) +295
   System.Data.SqlClient.SqlDataReader.Read() +38
   Rdnzl.Data.Db.ReadAction(Action`1 act, String connString, String storedProcedure, ArrayList parameters, CommandType cmdType, Int32 timeout) in C:\esdev\VS2019\Rdnzl\Rdnzl\Data\Db.vb:223
   Rdnzl.Data.Flights.FlightDate(Int64 tick) in C:\esdev\VS2019\Rdnzl\Rdnzl\Data\Flights.vb:211
   Ducis.Flight..ctor(User avt, Post pst, Int32 tpe) in C:\esdev\VS2019\Ducis\Ducis\Models\Flight.vb:180
   Ducis.FlightsController.FlightDate(String q) in C:\esdev\VS2019\Ducis\Ducis\Controllers\FlightController.vb:223
   lambda_method(Closure , ControllerBase , Object[] ) +139
   System.Web.Mvc.ControllerActionInvoker.InvokeActionMethod(ControllerContext controllerContext, ActionDescriptor actionDescriptor, IDictionary`2 parameters) +35
   System.Web.Mvc.Async.<>c.<BeginInvokeSynchronousActionMethod>b__9_0(IAsyncResult asyncResult, ActionInvocation innerInvokeState) +39
   System.Web.Mvc.Async.WrappedAsyncResult`2.CallEndDelegate(IAsyncResult asyncResult) +77
   System.Web.Mvc.Async.AsyncControllerActionInvoker.EndInvokeActionMethod(IAsyncResult asyncResult) +42
   System.Web.Mvc.Async.<>c__DisplayClass11_0.<InvokeActionMethodFilterAsynchronouslyRecursive>b__0() +80
   System.Web.Mvc.Async.<>c__DisplayClass11_2.<InvokeActionMethodFilterAsynchronouslyRecursive>b__2() +396
   System.Web.Mvc.Async.AsyncControllerActionInvoker.EndInvokeActionMethodWithFilters(IAsyncResult asyncResult) +42
   System.Web.Mvc.Async.<>c__DisplayClass3_6.<BeginInvokeAction>b__4() +50
   System.Web.Mvc.Async.<>c__DisplayClass3_1.<BeginInvokeAction>b__1(IAsyncResult asyncResult) +188
   System.Web.Mvc.Async.AsyncControllerActionInvoker.EndInvokeAction(IAsyncResult asyncResult) +38
   System.Web.Mvc.<>c.<BeginExecuteCore>b__152_1(IAsyncResult asyncResult, ExecuteCoreState innerState) +29
   System.Web.Mvc.Async.WrappedAsyncVoid`1.CallEndDelegate(IAsyncResult asyncResult) +73
   System.Web.Mvc.Controller.EndExecuteCore(IAsyncResult asyncResult) +52
   System.Web.Mvc.Async.WrappedAsyncVoid`1.CallEndDelegate(IAsyncResult asyncResult) +39
   System.Web.Mvc.Controller.EndExecute(IAsyncResult asyncResult) +38
   System.Web.Mvc.<>c.<BeginProcessRequest>b__20_1(IAsyncResult asyncResult, ProcessRequestState innerState) +43
   System.Web.Mvc.Async.WrappedAsyncVoid`1.CallEndDelegate(IAsyncResult asyncResult) +73
   System.Web.Mvc.MvcHandler.EndProcessRequest(IAsyncResult asyncResult) +38
   System.Web.CallHandlerExecutionStep.System.Web.HttpApplication.IExecutionStep.Execute() +651
   System.Web.HttpApplication.ExecuteStepImpl(IExecutionStep step) +220
   System.Web.HttpApplication.ExecuteStep(IExecutionStep step, Boolean& completedSynchronously) +134


Version Information: Microsoft .NET Framework Version:4.0.30319; ASP.NET Version:4.8.4494.0