title: Procedure or function 'approve' expects parameter '@ApproveID', which was not supplied
body: <p>i try to approve documents through following code</p>
  
  <pre><code>if (e.CommandName == "_Approve")
          {
              //using (SqlConnection con = DataAccess.GetConnected())
              using (SqlConnection con = new 
            SqlConnection(ConfigurationManager.ConnectionStrings["mydms"]
             .ConnectionString))
              {
                  try
                  {
                      con.Open();
                      int rowindex = Convert.ToInt32(e.CommandArgument);
                      GridViewRow row = (GridViewRow)
                     ((Control)e.CommandSource).NamingContainer;
                      Button Prove_Button = (Button)row.FindControl("BtnApprove");
                      SqlCommand cmd = new SqlCommand("approve", con);
                      cmd.CommandType = CommandType.StoredProcedure;
                      cmd.CommandType = CommandType.StoredProcedure;
                      cmd.Parameters.Add(new SqlParameter("@UserID", UserID));
                      cmd.Parameters.Add(new SqlParameter("@DocID", DocID));
                      cmd.Parameters.Add(new SqlParameter("@ApproveID", ApproveID));
                      int result = cmd.ExecuteNonQuery();
                      if (result != 0)
                      {
                          GrdFileApprove.DataBind();
                      }
                  }
  
                  catch
                  {
                      apfi.Text = "Not Approve";
  
  
  
                  }
                  finally
                  {
                      con.Close();
                  }
              }
          }
  
  
          else if (e.CommandName == "_Reject")
          {
              using (SqlConnection con = new 
            SqlConnection(ConfigurationManager.ConnectionStrings
          ["mydms"].ConnectionString))
              {
                  try
                  {
                      con.Open();
                      int rowindex = Convert.ToInt32(e.CommandArgument);
                      GridViewRow row = (GridViewRow)
                      ((Control)e.CommandSource).NamingContainer;
                      LinkButton Prove_Button = (LinkButton)row.FindControl("Button1");
                      SqlCommand cmd = new SqlCommand("sprejectapprove", con);
  
                      cmd.CommandType = CommandType.StoredProcedure;
                      cmd.Parameters.Add(new SqlParameter("@UserID",UserID));
                      cmd.Parameters.Add(new SqlParameter("@DocID", DocID));
                      cmd.Parameters.Add(new SqlParameter("@ApproveID", ApproveID));
                      int result = cmd.ExecuteNonQuery();
                      if (result != 0)
                      {
                          GrdFileApprove.DataBind();
                      }
                  }
  
                  catch 
                  {
                      apfi.Text = "Rejct";
                  }
                  finally
                  {
                      con.Close();
                  }
              }
          }
  </code></pre>
  
  <p>and approve store procedure is</p>
  
  <pre><code> @UserID int,
    @DocID int,
   @ApproveID int
  as
  insert into Approval(UserID,DocID,ApproveID)
  VALUES(@UserID,@DocID,@ApproveID)
  </code></pre>
  
  <p>and in sql there is approve type table in which there is columns approveid and 
  approve type and approve type has 3 types 1 is approve 2 reject and 3 is pending</p>
  
  <p>and in approve table there is userid,docid,approveid</p>
  
  <p>so when i debug the code it give me error in approve part catch </p>
  
  <blockquote>
    <p>Procedure or function 'approve' expects parameter '@ApproveID', which was not supplied.
    any help please
    thanku</p>
  </blockquote>