Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > ASP .Net > Called a Stored Procedure , decimal parameter

Reply
Thread Tools

Called a Stored Procedure , decimal parameter

 
 
Mona
Guest
Posts: n/a
 
      06-27-2003
I have a stored procedure with a decimal parameter .

how can send the decimal value?
I try this but it gives an error , invalid cast specified.

Dim p1 As SqlParameter = .Parameters.Add("@EstConstructionCost_10",
System.Data.SqlDbType.Decimal, 9).Value = CDbl(txtEstConstructionCost.Text)

' Dim p1 As SqlParameter = .Parameters.Add("@EstConstructionCost_10",
System.Data.SqlDbType.Decimal).Value = 10

p1.Precision = 10

p1.Scale = 0
I appreciate any help





 
Reply With Quote
 
 
 
 
Tu-Thach
Guest
Posts: n/a
 
      06-27-2003
You might want to use CDec instead of CDbl.

Tu-Thach

>-----Original Message-----
>I have a stored procedure with a decimal parameter .
>
>how can send the decimal value?
> I try this but it gives an error , invalid cast

specified.
>
>Dim p1 As SqlParameter = .Parameters.Add

("@EstConstructionCost_10",
>System.Data.SqlDbType.Decimal, 9).Value = CDbl

(txtEstConstructionCost.Text)
>
>' Dim p1 As SqlParameter = .Parameters.Add

("@EstConstructionCost_10",
>System.Data.SqlDbType.Decimal).Value = 10
>
>p1.Precision = 10
>
>p1.Scale = 0
>I appreciate any help
>
>
>
>
>
>.
>

 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Char(1) can't be insert from stored procedure called from C#/ASP.n JB ASP .Net 2 03-05-2010 08:23 AM
'Procedure or function <stored procedure name> has too many arguments specified',,,ARGH! Mike P ASP .Net 0 06-19-2006 01:19 PM
A question about using Decimal with Stored Procedure Ing. Rajesh Kumar ASP .Net 0 02-21-2004 04:53 PM
Call a stored procedure with decimal parameter Mona ASP .Net 2 06-27-2003 01:31 PM
Called a Stored Procedure , decimal parameter Mona ASP .Net Web Controls 0 06-27-2003 11:16 AM



Advertisments