S
sean
Hi There,
I am trying to make the transition from asp to asp.net, I have a stored
procedure that accepts an Integer parameter, when I pass the value from the
web form into the function I receive an error. I have tried the convert the
value using Cint (not sure if it is legal in ado.net) but I still get the
same error message.
Could someone help me out with the syntax please?
Sean
!-- code snippet
Dim intProductID as Integer
intProductID = Cint(txtProductID.Text)
Dim myConnection as New
SqlConnection(ConfigurationSettings.AppSettings("connectionString"))
myConnection.Open()
Dim myCommand As New SqlCommand("ProductsAdd", myConnection)
myCommand.CommandType = CommandType.StoredProcedure
Dim pProductID As New SqlParameter("@ProductID", SqlDbType.Int,4)
pProductID.Value = intProductID
myCommand.Parameters.Add(pProductID)
myCommand.ExecuteNonQuery()
I am trying to make the transition from asp to asp.net, I have a stored
procedure that accepts an Integer parameter, when I pass the value from the
web form into the function I receive an error. I have tried the convert the
value using Cint (not sure if it is legal in ado.net) but I still get the
same error message.
Could someone help me out with the syntax please?
Sean
!-- code snippet
Dim intProductID as Integer
intProductID = Cint(txtProductID.Text)
Dim myConnection as New
SqlConnection(ConfigurationSettings.AppSettings("connectionString"))
myConnection.Open()
Dim myCommand As New SqlCommand("ProductsAdd", myConnection)
myCommand.CommandType = CommandType.StoredProcedure
Dim pProductID As New SqlParameter("@ProductID", SqlDbType.Int,4)
pProductID.Value = intProductID
myCommand.Parameters.Add(pProductID)
myCommand.ExecuteNonQuery()