ridlejo
asked on
Need to insert decimal value
I am using visual web developer 2008 and .net 3.5. I have a simple insert statement that inserts a field value in to my table. On my web form I have a text field called TextBoxrt. In my table this is a decimal value. It will hold a dollar value. When I set my form variable and attempt to insert I get Conversion from string "rt" to type 'Integer' is not valid.
Here is my insert statement and parameter
Here is my insert statement and parameter
Dim cmd1 As New System.Data.SqlClient.SqlCommand("Insert Into users (rate) Values (@rt)", conn)
cmd1.Parameters.Add("@rt", System.Data.SqlDbType.Decimal, "rt").Value = request.form("TextBoxrt")
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
can you not do the same as before?
cmd1.Parameters.AddWithValue("@bl", Convert.ToByte(Request.Form("CheckBoxbl")))
ASKER
Thanks that did the trick. Then I just used an if statement for the check box. Thanks
ASKER
cmd1.Parameters.AddWithVal
But now I am having the same issue with a checkbox:
cmd1.Parameters.Add("@bl",
Any idea? I can post a new question and then you could answer it quickly??