Click here to Skip to main content
15,914,387 members
Please Sign up or sign in to vote.
1.00/5 (1 vote)
See more:
May i know what are the possible ways of getting error "Coverting Nvarchar to Numeric.MethodName". I've no FrontEnd Source Code for that but i've it's db. I checked the stored procedure and Table structure. I checked the Column size and types as well. In stored procedure all the parameters are having similar Types,Size of the table. Still it's raising issue. when im executing relevant stored Procedure manually then data is inserting to the Database. For my present source everything working fyn. But For other source wen im running the application it's raising runtime error as like as that.
Posted
Updated 20-Oct-15 19:21pm
v5

1 solution

Without seeing the code that generates the error we can't be at all specific.
But...normally this is a data / database design problem: you are storing a numeric value in a string field and at some point when you try to convert it to a numeric value at least of of the cells in your database contains bad data. It may be that the user made a mistake and you don't check your inputs, so you are trying to convert "zero" to an integer. It may be that he just mistyped: "1O23" instead of"1023".

Change your DB: store numeric values in numeric fields. Store dates and times in DATETIME. Don't just store all data in NVARCHAR(MAX) fields.
 
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