kkonkle
Member
I am using the following Stored Procedure and I have seen it work. I have the database entries to prove it... however, most times the Catch block is triggered with the error:
"Procedure Insert_Results expects parameter @errMessage, which was not supplied."
Can anyone see why that would be? I am clearly creating and passing in a parameter named @errMessage.
"Procedure Insert_Results expects parameter @errMessage, which was not supplied."
Can anyone see why that would be? I am clearly creating and passing in a parameter named @errMessage.
Code:
With cmd3
.CommandType = CommandType.StoredProcedure
.CommandText = "Insert_Results"
.Parameters.Clear()
Dim param1 As New SqlParameter("@programName", SqlDbType.VarChar)
param1.Value = PROGRAM_NAME
.Parameters.Add(param1)
Dim param2 As New SqlParameter("@statusMessage", SqlDbType.VarChar)
param2.Value = statusMsg
.Parameters.Add(param2)
Dim param3 As New SqlParameter("@errMessage", SqlDbType.VarChar)
param3.Value = errMsg
.Parameters.Add(param3)
End With
Try
cn3.Open()
cmd3.ExecuteNonQuery()
cn3.Close()
cmd3.CommandType = CommandType.Text
Catch ex As Exception
If cn3.State = ConnectionState.Open Then
cn3.Close()
End If
cmd3.CommandType = CommandType.Text
End Try