-2

レコードを更新しようとするとエラーが発生しました

プロシージャまたは関数に(sp_UpdateEmp)(@dateofbirth)、指定されていないパラメータが必要です

これが私の機能です

public void Updatedata(Bussinessobject.BO EBAL)
{
  objconn = new SqlConnection(connectionstring);
  if (objconn.State != ConnectionState.Open)
  try
  {
    objconn.Open();
    objcommand = new SqlCommand("sp_UpdateEmp", objconn);
    objcommand.CommandType = CommandType.StoredProcedure;
    objcommand.Parameters.AddWithValue("@id", EBAL.id);
    objcommand.Parameters.AddWithValue("@fname", EBAL.fname);
    objcommand.Parameters.AddWithValue("@lname", EBAL.lname);
    objcommand.Parameters.AddWithValue("@address", EBAL.address);
    objcommand.Parameters.AddWithValue("@phone", EBAL.phone);
    objcommand.Parameters.AddWithValue("@birthdate", EBAL.birthdate);
    objcommand.Parameters.AddWithValue("@hiredate", EBAL.datehire);
    objcommand.Parameters.AddWithValue("@gender", EBAL.gender);

    objcommand.ExecuteNonQuery();
  }
  catch
  {
    throw;
  }
}
4

3 に答える 3