Dim db As Database = DatabaseFactory.CreateDatabase()
Dim sqlCommand As String = "CategoryListShow"
Dim cmd As DbCommand = db.GetStoredProcCommand(sqlCommand)
cmd.Parameters.Add(New SqlParameter("@ID", SqlDbType.Int).Direction = ParameterDirection.Input)
cmd.Parameters.Add(New SqlParameter("@ID", SqlDbType.Int, 4).Value = CategoryIdTxt.Text.Trim())
cmd.Parameters.Add(New SqlParameter("@CategoryResult", SqlDbType.VarChar, 50).Direction = ParameterDirection.Output)
Dim sqlReader As SqlDataReader = cmd.ExecuteReader()
txtCategory.Text = cmd.Parameters("@CategoryResult").Value.ToString()
sqlReader.Close()
I am calling a Stored Procedure "CategoryListShow". The Stored Procedure has two parameters one is ID which is the Input Parameter and CategoryResult is the output parameter. I am trying to display the value of the output parameters onto this textbox txtCategory.Text.
Error : Yellow screen saying this
The SqlParameterCollection only accepts non-null SqlParameter type objects, not Boolean objects.
Please guide me.