Note that there are some explanatory texts on larger screens.

plurals
  1. POMy stored procedure doesn't update when the button is clicked
    primarykey
    data
    text
    <p>Here is my stored procedure that does the update and when I test the procedure using SQL Server it works perfectly.</p> <pre><code>ALTER PROCEDURE [TKSFlex].[UpdateComment] -- Add the parameters for the stored procedure here @Comment char(50), @Employee char(25) AS BEGIN TRANSACTION -- SET NOCOUNT ON added to prevent extra result sets from -- interfering with SELECT statements. SET NOCOUNT On; -- Insert statements for procedure here Update whiteboard set Comment = @Comment where Employee = @Employee COMMIT </code></pre> <p>And here is the code executed when the update button is clicked</p> <pre><code>Private Sub btnUpdate_Click(ByVal sender As System.Object, ByVal es System.EventArgs) Handles btnUpdate.Click InputsModule.Employee = "'Mathe BF'" Objconn.Open() dbcommand.Connection = Objconn dbcommand.CommandType = CommandType.StoredProcedure dbcommand.CommandText = "[TKSFlex].[UpdateComment]" dbcommand.Parameters.AddWithValue("@Comment", txtComment.Text) dbcommand.Parameters.AddWithValue("@Employee", InputsModule.Employee) 'dbcommand.Parameters.Add("@Comment", SqlDbType.Char).Value = txtComment.Text 'dbcommand.Parameters.Add("@Employee", SqlDbType.Char).Value = InputsModule.Employee Dim i As Integer = 0 Try i = dbcommand.ExecuteNonQuery() Catch ex As SqlException MsgBox("failed") End Try Objconn.Close() End Sub </code></pre> <p>By the table doesn't get updated when the query is executed and an Exception doesn't get thrown, which implies the the code does get executed but no modification is made to the database, I'm just not sure where I went wrong</p>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload