Click here to Skip to main content
15,897,371 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
Server Error in '/' Application.

Error converting data type nvarchar to int.

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: Error converting data type nvarchar to int.

Source Error:

An unhandled exception was generated during the execution of the current web request. Information regarding the origin and location of the exception can be identified using the exception stack trace below.

Stack Trace:


[SqlException (0x80131904): Error converting data type nvarchar to int.]
CETLib.ApplicationBo.InsertCardInfo(CardDetails objPersonal) +79
CETNew.Controllers.AccountController.Application(PersonalInfoModel model) +2238
lambda_method(Closure , ControllerBase , Object[] ) +139
System.Web.Mvc.ReflectedActionDescriptor.Execute(ControllerContext controllerContext, IDictionary`2 parameters) +229
System.Web.Mvc.ControllerActionInvoker.InvokeActionMethod(ControllerContext controllerContext, ActionDescriptor actionDescriptor, IDictionary`2 parameters) +35
System.Web.Mvc.Async.AsyncControllerActionInvoker.<begininvokesynchronousactionmethod>b__39(IAsyncResult asyncResult, ActionInvocation innerInvokeState) +39
System.Web.Mvc.Async.WrappedAsyncResult`2.CallEndDelegate(IAsyncResult asyncResult) +67
System.Web.Mvc.Async.AsyncControllerActionInvoker.EndInvokeActionMethod(IAsyncResult asyncResult) +42
System.Web.Mvc.Async.AsyncInvocationWithFilters.<invokeactionmethodfilterasynchronouslyrecursive>b__3d() +72
System.Web.Mvc.Async.<>c__DisplayClass46.<invokeactionmethodfilterasynchronouslyrecursive>b__3f() +385
System.Web.Mvc.Async.<>c__DisplayClass46.<invokeactionmethodfilterasynchronouslyrecursive>b__3f() +385
System.Web.Mvc.Async.AsyncControllerActionInvoker.EndInvokeActionMethodWithFilters(IAsyncResult asyncResult) +42
System.Web.Mvc.Async.<>c__DisplayClass2b.<begininvokeaction>b__1c() +38
System.Web.Mvc.Async.<>c__DisplayClass21.<begininvokeaction>b__1e(IAsyncResult asyncResult) +185
System.Web.Mvc.Async.AsyncControllerActionInvoker.EndInvokeAction(IAsyncResult asyncResult) +38
System.Web.Mvc.Controller.<beginexecutecore>b__1d(IAsyncResult asyncResult, ExecuteCoreState innerState) +29
System.Web.Mvc.Async.WrappedAsyncVoid`1.CallEndDelegate(IAsyncResult asyncResult) +65
System.Web.Mvc.Controller.EndExecuteCore(IAsyncResult asyncResult) +52
System.Web.Mvc.Async.WrappedAsyncVoid`1.CallEndDelegate(IAsyncResult asyncResult) +36
System.Web.Mvc.Controller.EndExecute(IAsyncResult asyncResult) +38
System.Web.Mvc.MvcHandler.<beginprocessrequest>b__5(IAsyncResult asyncResult, ProcessRequestState innerState) +43
System.Web.Mvc.Async.WrappedAsyncVoid`1.CallEndDelegate(IAsyncResult asyncResult) +65
System.Web.Mvc.MvcHandler.EndProcessRequest(IAsyncResult asyncResult) +38
System.Web.CallHandlerExecutionStep.System.Web.HttpApplication.IExecutionStep.Execute() +393
System.Web.HttpApplication.ExecuteStepImpl(IExecutionStep step) +195
System.Web.HttpApplication.ExecuteStep(IExecutionStep step, Boolean& completedSynchronously) +128

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

What I have tried:

Nothing yet please help out this is very importent
Posted
Updated 12-Jul-18 3:46am
Comments
Dave Kreskowiak 11-Jul-18 15:42pm    
You have a problem with an SQL statement you executed. It's telling you you're trying to convert text to an integer, probably because the text you're trying to convert cannot be converted to an integer.

Other than that, there isn't anything more to say because we have no idea what that SQL statement is, nor do we know anything about the code you wrote to create that statement.

We can only work with what you type here.
Patrice T 11-Jul-18 16:23pm    
And you have some code ?
ZurdoDev 11-Jul-18 16:36pm    
I second what Dave said.

1 solution

What is so hard to understand on:
[SqlException (0x80131904): Error converting data type nvarchar to int.]
In the first line you read that an exception occured when you converted a nvarchar (some String) into an int.

Use the debugger by setting a breakpoint into the second line of your error:
CETLib.ApplicationBo.InsertCardInfo(CardDetails objPersonal)
to dig into the details.

It all stands in the error message. You only have to read and understand it ;-)
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900