Called a Stored Procedure , decimal parameter

Discussion in 'ASP .Net' started by Mona, Jun 27, 2003.

  1. Mona

    Mona Guest

    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
     
    Mona, Jun 27, 2003
    #1
    1. Advertising

  2. Mona

    Tu-Thach Guest

    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
    >
    >
    >
    >
    >
    >.
    >
     
    Tu-Thach, Jun 27, 2003
    #2
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Mona
    Replies:
    2
    Views:
    702
    Rajesh Tiwari
    Jun 27, 2003
  2. Ing. Rajesh Kumar
    Replies:
    0
    Views:
    298
    Ing. Rajesh Kumar
    Feb 21, 2004
  3. Mike P
    Replies:
    0
    Views:
    3,352
    Mike P
    Jun 19, 2006
  4. JB
    Replies:
    2
    Views:
    931
    Göran Andersson
    Mar 5, 2010
  5. Mona

    Called a Stored Procedure , decimal parameter

    Mona, Jun 27, 2003, in forum: ASP .Net Web Controls
    Replies:
    0
    Views:
    351
Loading...

Share This Page