Error Converting data type 'Numeric' to Decimal (help!)

Although the original poster has found his solution, for the benefit of other people, I thought I would post what caused it for me.

System.Data.SqlClient.SqlException : Error converting data type numeric to decimal.

Sadly the message doesn't say which parameter it is having the problem with. So I changed all of the parameters that I was passing through to have a value of 0 (which is a suitable value for most SQL types, you may need to use other values), this made the error go away. I could then put them back to normal, one by one, and each time, I re-tested. That's how I worked out which parameter had the problem.

It turned out that for one of the parameters the value that I had in my code (a C# decimal) was too large to go in the decimal(7,2) stored procedure parameter.


Found The answer! my stored Procedure is wrong i have decimal(9,6) in my stored procedured making it accept 3 digits or less !changed it to (18,2)\