I am trying to insert data into a SQL Server database by calling a stored procedure, but I am getting the error
*Procedure or function \'Insertion\'
Your Insertion stored procedure is expecting @Emp_no
(along with about 15 other parameters). You cannot call the stored procedure without passing the parameters.
Take a look at this site for reference:
http://msdn.microsoft.com/en-us/library/system.data.sqlclient.sqlparametercollection.addwithvalue.aspx?cs-save-lang=1&cs-lang=csharp#code-snippet-2
Everywhere you're defining variables, use Parameters.AddWithValue
instead:
cmd.Parameters.AddWithValue("@Emp_no ", Convert.ToInt32(txtbx_Empno.Text));