1
Reply

Error Occured System.Data.SqlClient.SqlException: Procedure or function tbl_Appraiser_InsertOrUpdateHardAppRate has too many arguments specified.

SIVA

SIVA

Jan 11 2012 12:16 PM
2.2k
Hi All,
I have following stored procedure.

ALTER PROCEDURE
tbl_Appraiser_InsertOrUpdateHardAppRate(@EmpID int,@JK1_AppRate int,@JK2_AppRate int,@CF1_AppRate int,@CF2_AppRate int,@RO1_AppRate int,@RO2_AppRate int,@Quality_AppRate int)As
Begin


update tbl_Appraiser set JK1_AppRate =@JK1_AppRate, JK2_AppRate=@JK2_AppRate,CF1_AppRate=@CF1_AppRate, CF2_AppRate=@CF2_AppRate,RO1_AppRate=@RO1_AppRate, RO2_AppRate=@RO2_AppRate,Quality_AppRate=@Quality_AppRate where EmpID=@EmpIDEnd


and I am trying to insert the following data into database

In form
oProp.JK1_AppRate =int.Parse(ddJK1App.SelectedValue);
oProp.JK2_AppRate =int.Parse(ddJK2App.SelectedValue);
oProp.CF1_AppRate =int.Parse(ddCF1App.SelectedValue);
oProp.CF2_AppRate =int.Parse(ddCF2App.SelectedValue);
oProp.RO1_AppRate =int.Parse(ddRO1App.SelectedValue);
oProp.RO2_AppRate =int.Parse(ddRO2App.SelectedValue);
oProp.Quality_AppRate = int.Parse(ddQApp.SelectedValue);
_iCount = oData.UpdateEmpDetailsHard(oProp, oProp.EmpID,int.Parse(ID));


In Data Class
oCmd.CommandText ="tbl_Appraiser_InsertOrUpdateHardAppRate";
oCmd.Parameters.AddWithValue("@EmpID", oProp.EmpID);
oCmd.Parameters.AddWithValue("@JK1_AppRate", oProp.JK1_AppRate);
oCmd.Parameters.AddWithValue("@JK2_AppRate", oProp.JK2_AppRate);
oCmd.Parameters.AddWithValue("@CF1_AppRate", oProp.CF1_AppRate);
oCmd.Parameters.AddWithValue("@CF2_AppRate", oProp.CF2_AppRate);
oCmd.Parameters.AddWithValue("@RO1_AppRate", oProp.RO1_AppRate);
oCmd.Parameters.AddWithValue("@RO2_AppRate", oProp.RO2_AppRate);
oCmd.Parameters.AddWithValue("@Quality_AppRate", oProp.Quality_AppRate);
_iCount = oCmd.ExecuteNonQuery();

Its successfully Debugging the code but when it step into
 _iCount = oCmd.ExecuteNonQuery();

its returning 0 that states that command execution failed & i got the following error..

Error Occured System.Data.SqlClient.SqlException: Procedure or function tbl_Appraiser_InsertOrUpdateHardAppRate has too many arguments specified.

Answers (1)