Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Parameter Precision using ExecSprocScalar()
Message
From
13/10/2010 10:43:23
 
 
To
13/10/2010 10:35:28
General information
Forum:
ASP.NET
Category:
The Mere Mortals .NET Framework
Miscellaneous
Thread ID:
01485294
Message ID:
01485317
Views:
23
>>>How do I set the parameter precision so that it returns 2 decimal places?
>>>
>>>This is my code:
>>>
>>>
            Decimal defaultValue = 0.00M;
>>>            IDbDataParameter param1 = this.CreateParameter("@PolicyHeaderPK", policyHeaderFK);
>>>            IDbDataParameter param2 = this.CreateParameter("@SuspenseAmount", defaultValue);
>>>            param2.Direction = ParameterDirection.Output;
>>>
>>>            // how do I do this: 
>>>            //param2.Precision = "18,2";
>>>
>>>            // Call the stored procedure and pass the parameter
>>>            IDbCommand cmd;
>>>            this.ExecSprocScalar("PoliciesGetSuspenseAmount", out cmd, param1, param2);
>>>
>>>            // Retrieve the value from the command object
>>>            IDbDataParameter param = (IDbDataParameter)cmd.Parameters["@SuspenseAmount"];
>>>            Decimal suspenseAmount = (Decimal)param.Value;
>>
>>Try
>>
>>Param.Size = 19;
>>Param.Precision = 2
>
>no luck, still getting 70 returned :(

Got it!

Param.Precision = 18;
param.Scale = 2;

thanks again for pointing me in the right direction.
Frank.

Frank Cazabon
Samaan Systems Ltd.
www.samaansystems.com
Previous
Reply
Map
View

Click here to load this message in the networking platform