Error occured: Procedure .. has too many argument specified
I have an issue that when i Update the record there is error "Error occured: Procedure .. has too many argument specified". It is my Store procedure
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
ALTER Procedure [dbo].[web_usp_empData_Update]
@id bigint,
@Code nvarchar(10),
@Name nvarchar(50),
@Address nvarchar(150),
@Tel nvarchar(20),
@HP nvarchar(20),
@email nvarchar(50),
@NRIC nvarchar(20),
@Jobtitle nvarchar(50),
@Dept nvarchar(20)
As
Begin
Update empData
Set
[Code] = @Code,
[Name] = @Name,
[Address] = @Address,
[Tel] = @Tel,
[HP] = @HP,
[email] = @email,
[NRIC] = @NRIC,
[Jobtitle] = @Jobtitle,
[Dept] = @Dept
Where
[id] = @id
End
My update code
cmd.Connection = conn
cmd.CommandText = ("web_usp_empData_Update")
cmd.Parameters.Add(New SqlParameter("@id", Session("empID")))
cmd.CommandType = CommandType.StoredProcedure
Try
cmd.Parameters.AddWithValue("@Code", Me.txtCode.Text)
cmd.Parameters.AddWithValue("@Name", UCase(Me.txtName.Text))
cmd.Parameters.AddWithValue("@Address", Me.txtAddress.Text)
cmd.Parameters.AddWithValue("@Tel", Me.txtTel.Text)
cmd.Parameters.AddWithValue("@Hp", Me.txtHP.Text)
cmd.Parameters.AddWithValue("@email", Me.txtEmail.Text)
cmd.Parameters.AddWithValue("@Nric", Me.txtNRIC.Text)
cmd.Parameters.AddWithValue("@Jobtitle", Me.cboJobTitle.SelectedValue)
cmd.Parameters.AddWithValue("@Dept", Me.cboDepartment.SelectedValue)
conn.Open()
cmd.ExecuteNonQuery()
cmd.Dispose()
conn.Close()
Response.Redirect("empVIEW.aspx")
ScriptManager.RegisterStartupScript(Page, Page.GetType(), "alert", "alert('Updated!');", True)
Catch ex As Exception
ScriptManager.RegisterStartupScript(Me, Me.[GetType](), "Message", "alert('Error occured : " & ex.Message.ToString() & "');", True)
Finally
cmd.Dispose()
conn.Close()
End Try