12,073,325 members (67,416 online)
Rate this:
Please Sign up or sign in to vote.
See more:
how to solve this problem
actually i want to insert numeric(18,0) value in sql server and i am passing decimal value but getting this error ?
how to solve this problem plz help me!!!
thanks in advance
Posted 19-Apr-12 20:19pm
Comments
Sebastian T Xavier 20-Apr-12 1:24am

can you show us the code?

## 2 solutions

Rate this:
Please Sign up or sign in to vote.

## Solution 1

Hi,

numeric(18,0) means

a number that has 18 (or less) digits before the decimal and 0 digits after the decimal.

Please check, how many digits are there after decimal in your value (That you are passing for insertion)..
Rate this:
Please Sign up or sign in to vote.

## Solution 3

If your code is like the following :
```public void method(int i, ref decimal d)
{
...
}```
Then you must call this method like the following so you wouldn't get the error you mentioned:
```...
decimal d = 9;
int i = 1;
method(i, ref d);
...```

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

Top Experts
Last 24hrsThis month
 OriginalGriff 510 Dave Kreskowiak 475 CPallini 335 F-ES Sitecore 210 CHill60 200
 Dave Kreskowiak 2,511 OriginalGriff 2,164 Richard MacCutchan 1,675 CPallini 1,387 CHill60 1,219

Advertise | Privacy | Mobile
Web03 | 2.8.160208.1 | Last Updated 20 Apr 2012
Copyright © CodeProject, 1999-2016
All Rights Reserved. Terms of Service
Layout: fixed | fluid

CodeProject, 503-250 Ferrand Drive Toronto Ontario, M3C 3G8 Canada +1 416-849-8900 x 100