This topic is locked

SqlException (0x80131904)

3/22/2021 6:51:25 AM
ASPRunner.NET General questions
M
Mansour author

When i execute the program from the built-in server or from demo host it will work correctly, but when i execute it from cloud or ISS server below error appers to me when i try to add/delete/update any things

can any body help me to solve this problem please?
[SqlException (0x80131904): The conversion of a varchar data type to a datetime data type resulted in an out-of-range value.

The statement has been terminated.]

runnerDotNet.Connection.queryMultiple(XVar sqlStrings, Boolean resultNeeded) in c:\Users\PC\Documents\ASPRunnerNETProjects\Project4\output\connections\Connection.cs:250

System.Dynamic.UpdateDelegates.UpdateAndExecute2(CallSite site, T0 arg0, T1 arg1) +698

runnerDotNet.AuditTrailTable.insert(Object _param_datetime, Object _param_ip, Object _param_user, Object _param_table, Object _param_action, Object _param_description) in c:\Users\PC\Documents\ASPRunnerNETProjects\Project4\output\include\audit.cs:736

runnerDotNet.AuditTrailTable.LogAdd(Object _param_str_table, Object _param_values, Object _param_keys) in c:\Users\PC\Documents\ASPRunnerNETProjects\Project4\output\include\audit.cs:141

System.Dynamic.UpdateDelegates.UpdateAndExecuteVoid4(CallSite site, T0 arg0, T1 arg1, T2 arg2, T3 arg3) +776

runnerDotNet.AddPage.processDataInput() in c:\Users\PC\Documents\ASPRunnerNETProjects\Project4\output\Classes\addpage.cs:333

runnerDotNet.AddPage.process() in c:\Users\PC\Documents\ASPRunnerNETProjects\Project4\output\Classes\addpage.cs:226

runnerDotNet.productsController.add() in c:\Users\PC\Documents\ASPRunnerNETProjects\Project4\output\Controllers\products\add.cs:75

lambda_method(Closure , ControllerBase , Object[] ) +87

System.Web.Mvc.ReflectedActionDescriptor.Execute(ControllerContext controllerContext, IDictionary2 parameters) +280
System.Web.Mvc.ControllerActionInvoker.InvokeActionMethod(ControllerContext controllerContext, ActionDescriptor actionDescriptor, IDictionary
2 parameters) +35

System.Web.Mvc.<>cDisplayClass15.<InvokeActionMethodWithFilters>b12() +80

System.Web.Mvc.ControllerActionInvoker.InvokeActionMethodFilter(IActionFilter filter, ActionExecutingContext preContext, Func`1 continuation) +466

System.Web.Mvc.ControllerActionInvoker.InvokeAction(ControllerContext controllerContext, String actionName) +659

System.Web.Mvc.Controller.ExecuteCore() +146

runnerDotNet.BaseController.ExecuteThread(Object arg) in c:\Users\PC\Documents\ASPRunnerNETProjects\Project4\output\Controllers\BaseController.cs:45
[AggregateException: حدث خطأ واحد أو أكثر.]

runnerDotNet.BaseController.ExecuteCore() in c:\Users\PC\Documents\ASPRunnerNETProjects\Project4\output\Controllers\BaseController.cs:32

System.Web.Mvc.ControllerBase.Execute(RequestContext requestContext) +91

System.Web.Mvc.<>cDisplayClassb.<BeginProcessRequest>b5() +60

System.Web.Mvc.Async.<>cDisplayClass1.<MakeVoidDelegate>b0() +25

System.Web.Mvc.<>cDisplayClasse.<EndProcessRequest>bd() +36

System.Web.CallHandlerExecutionStep.System.Web.HttpApplication.IExecutionStep.Execute() +431

System.Web.HttpApplication.ExecuteStepImpl(IExecutionStep step) +75

System.Web.HttpApplication.ExecuteStep(IExecutionStep step, Boolean& completedSynchronously) +158

FrankR_ENTA 3/22/2021



When i execute the program from the built-in server or from demo host it will work correctly, but when i execute it from cloud or ISS server below error appers to me when i try to add/delete/update any things

can any body help me to solve this problem please?
[SqlException (0x80131904): The conversion of a varchar data type to a datetime data type resulted in an out-of-range value.

The statement has been terminated.]

runnerDotNet.Connection.queryMultiple(XVar sqlStrings, Boolean resultNeeded) in c:\Users\PC\Documents\ASPRunnerNETProjects\Project4\output\connections\Connection.cs:250

System.Dynamic.UpdateDelegates.UpdateAndExecute2(CallSite site, T0 arg0, T1 arg1) +698

runnerDotNet.AuditTrailTable.insert(Object _param_datetime, Object _param_ip, Object _param_user, Object _param_table, Object _param_action, Object _param_description) in c:\Users\PC\Documents\ASPRunnerNETProjects\Project4\output\include\audit.cs:736

runnerDotNet.AuditTrailTable.LogAdd(Object _param_str_table, Object _param_values, Object _param_keys) in c:\Users\PC\Documents\ASPRunnerNETProjects\Project4\output\include\audit.cs:141

System.Dynamic.UpdateDelegates.UpdateAndExecuteVoid4(CallSite site, T0 arg0, T1 arg1, T2 arg2, T3 arg3) +776

runnerDotNet.AddPage.processDataInput() in c:\Users\PC\Documents\ASPRunnerNETProjects\Project4\output\Classes\addpage.cs:333

runnerDotNet.AddPage.process() in c:\Users\PC\Documents\ASPRunnerNETProjects\Project4\output\Classes\addpage.cs:226

runnerDotNet.productsController.add() in c:\Users\PC\Documents\ASPRunnerNETProjects\Project4\output\Controllers\products\add.cs:75

lambda_method(Closure , ControllerBase , Object[] ) +87

System.Web.Mvc.ReflectedActionDescriptor.Execute(ControllerContext controllerContext, IDictionary2 parameters) +280
System.Web.Mvc.ControllerActionInvoker.InvokeActionMethod(ControllerContext controllerContext, ActionDescriptor actionDescriptor, IDictionary
2 parameters) +35

System.Web.Mvc.<>cDisplayClass15.<InvokeActionMethodWithFilters>b12() +80

System.Web.Mvc.ControllerActionInvoker.InvokeActionMethodFilter(IActionFilter filter, ActionExecutingContext preContext, Func`1 continuation) +466

System.Web.Mvc.ControllerActionInvoker.InvokeAction(ControllerContext controllerContext, String actionName) +659

System.Web.Mvc.Controller.ExecuteCore() +146

runnerDotNet.BaseController.ExecuteThread(Object arg) in c:\Users\PC\Documents\ASPRunnerNETProjects\Project4\output\Controllers\BaseController.cs:45
[AggregateException: حدث خطأ واحد أو أكثر.]

runnerDotNet.BaseController.ExecuteCore() in c:\Users\PC\Documents\ASPRunnerNETProjects\Project4\output\Controllers\BaseController.cs:32

System.Web.Mvc.ControllerBase.Execute(RequestContext requestContext) +91

System.Web.Mvc.<>cDisplayClassb.<BeginProcessRequest>b5() +60

System.Web.Mvc.Async.<>cDisplayClass1.<MakeVoidDelegate>b0() +25

System.Web.Mvc.<>cDisplayClasse.<EndProcessRequest>bd() +36

System.Web.CallHandlerExecutionStep.System.Web.HttpApplication.IExecutionStep.Execute() +431

System.Web.HttpApplication.ExecuteStepImpl(IExecutionStep step) +75

System.Web.HttpApplication.ExecuteStep(IExecutionStep step, Boolean& completedSynchronously) +158


SQL Server account being used by the app probably does not have Insert, Update, or Delete permission.

admin 3/22/2021



The conversion of a varchar data type to a datetime data type resulted in an out-of-range value.


It sounds like an incorrect format of the datetime field, SQL Server is not able to convert the string to a datetime value. Does it make sense?

M
Mansour author 3/22/2021



It sounds like an incorrect format of the datetime field, SQL Server is not able to convert the string to a datetime value. Does it make sense?


but why it is referred to this location in the PC
c:\Users\PC\Documents\ASPRunnerNETProjects\Project4\output\Controllers\BaseController.cs:45

admin 3/22/2021

It points to a location in the source files where the failing line of code is located. However, there is no problem with the line of the code or with the whole file. The problem is with the SQL query.
You need to figure out what kind of string is being passed to the date/datetime field that breaks the SQL.
If this info doesn't point you in the right direction I recommend posting your project to Demo Account and contacting support directly.

M
Mansour author 3/23/2021



It points to a location in the source files where the failing line of code is located. However, there is no problem with the line of the code or with the whole file. The problem is with the SQL query.
You need to figure out what kind of string is being passed to the date/datetime field that breaks the SQL.
If this info doesn't point you in the right direction I recommend posting your project to Demo Account and contacting support directly.


I test the same project om the other PC it is working without problem, Also the some of pages which has this error I don't use any Date variable in it.