If you know that the SqlDecimal precision is 9 and the scale is 3, you can
simply do a range validation like the example below.
private bool IsInBound(decimal DecimalValue)
{
if((DecimalValue > 999999.999m) || (DecimalValue < -999999.999m))
return false;
return true;
}
--
Hope this helps.
Dan Guzman
SQL Server MVP
"Zeng" <Ze******@hotmail.com> wrote in message
news:uP**************@TK2MSFTNGP11.phx.gbl...
Hello,
I have many fields in my SQL database that are of type decimal(9,3). How
do
I detect a decimal value (type decimal in C#) will overflow the db column
of
sql type decimal (9,3)? Is there a way to figure out the min/max
constants
of decimal(9,3) to compare against in C# to make sure the new value is "in
bound"?
Thanks!
-zeng