Ok basically I'm trying to store a monetary value in a sql database. In the database my field is "Price" and I've set it to a Real value. So far so good.
Thing thats confusing me is what to call the variable in asp.net, a String? An Int?
This is basically the code the runs the stored proc:
And this is the stored proc code:
However, when I'm trying to update, this is the error I'm getting and for the likes of me I just cannot figure it out:
http://img25.imageshack.us/i/errorew.jpg/
needing some input pls guys!
Thing thats confusing me is what to call the variable in asp.net, a String? An Int?
This is basically the code the runs the stored proc:
Code:
Dim strSQL as string
Dim strGCProductCode as string
Dim strGCDescription as string
Dim strGCPrice
strGCProductCode = Trim(txtGCProductCode.Text)
strGCDescription = Trim(txtGCDescription.Text)
strGCPrice = Trim(txtGCPrice.Text)
strSQL = "ProcUpdateGCDetails " & "'"
strSQL = strSQL & strGCProductCode & "', '"
strSQL = strSQL & strGCDescription & "', '"
strSQL = strSQL & strGCPrice & "', "
strSQL = strSQL & cInt(Request.QueryString("ProductID"))
And this is the stored proc code:
Code:
CREATE PROCEDURE [dbo].[ProcUpdateGCDetails]
(
@strGCProductCode Varchar(50),
@strGCDescription Varchar(50),
@ProductID Int,
@strGCPrice Smallmoney)
AS UPDATE dbo.tblGCProducts
SET ProductCode=@strGCProductCode,
Description=@strGCDescription,
Price=@strGCPrice
WHERE (ProductID = @ProductID)
However, when I'm trying to update, this is the error I'm getting and for the likes of me I just cannot figure it out:
http://img25.imageshack.us/i/errorew.jpg/
needing some input pls guys!