title: Procedure or function has too many arguments specified winform c#
body: <pre><code>SqlCommand cmmd = new SqlCommand("INSERT into Vows(MemberID, VowAmount, VowDate, Description) Values (@MemberID, @vowAmount, @vowDate, @vowDesc)", con);
  
  SqlCommand storedprocedure = new SqlCommand("UPDATEINCOME", con);
  storedprocedure.CommandType = CommandType.StoredProcedure;
  storedprocedure.Parameters.Add(new SqlParameter("@IncomeDate", SqlDbType.Date)).Value = vowdateTime.Text;
  
  SqlCommand insertStoredProcedure = new SqlCommand("InsertIncomeDate", con);
  insertStoredProcedure.CommandType = CommandType.StoredProcedure;
  
  insertStoredProcedure.Parameters.Add(new SqlParameter("@IncomeDate", SqlDbType.Date)).Value = vowdateTime.Text;
  insertStoredProcedure.Parameters.Add("@IncomeDate", SqlDbType.Date).Direction = ParameterDirection.Input;
  insertStoredProcedure.Parameters.Add("@IncomeDate", SqlDbType.Date).Direction = ParameterDirection.Input;
  </code></pre>
  
  <p>Here are my codes and I get the error that: </p>
  
  <blockquote>
    <p>Procedure or function has too many arguments specified</p>
  </blockquote>
  
  <pre><code>cmmd.Parameters.AddWithValue("@MemberID", vowMemID.Text);
  cmmd.Parameters.AddWithValue("@vowAmount", vowAmount.Text);
  cmmd.Parameters.AddWithValue("@vowDate", vowdateTime.Text);
  cmmd.Parameters.AddWithValue("@vowDesc", vowDescBox.Text);
  cmmd.ExecuteNonQuery();                   
  
  insertStoredProcedure.ExecuteNonQuery();  // error occurs here
  insertStoredProcedure.Parameters.Clear();
  
  storedprocedure.ExecuteNonQuery();    // and here
  storedprocedure.Parameters.Clear();
  </code></pre>
  
  <p>These are the stored procedures:</p>
  
  <pre><code>ALTER PROCEDURE [dbo].[UPDATEINCOME] 
      (@IncomeDate date, @VowAmount money) 
  AS
      Declare @TitheAmount money
      Declare @OfferingAmount money
      Declare @IncomeTotal money
  
      IF NOT EXISTS (Select VowDate from Vows where VowDate = @IncomeDate)
      BEGIN
          set @VowAmount = '0'
      END
      ELSE 
      BEGIN
          set @VowAmount = (Select VowAmount from Vows where VowDate = @IncomeDate)
      END
  
      IF NOT EXISTS (Select OfferingDate from Offering where OfferingDate = @IncomeDate)
      BEGIN
          set @OfferingAmount = '0'
      END
      ELSE 
      BEGIN
         set @OfferingAmount = (Select OfferingAmount from Offering where OfferingDate = @IncomeDate)
      END
  
      IF NOT EXISTS (Select TitheDate from Tithe where TitheDate = @IncomeDate)
      BEGIN
          set @TitheAmount = '0'
      END
      ELSE
      BEGIN
         Set @TitheAmount = (Select TitheAmount from Tithe where TitheDate = @IncomeDate)
      END
  
      Set @IncomeTotal = @TitheAmount + @VowAmount + @OfferingAmount
  
      UPDATE IncomeReport 
      SET Amount = @IncomeTotal 
      WHERE IncDATE = @IncomeDate
  </code></pre>
  
  <p>The <code>UPDATEINCOME</code> stored procedure updates the <code>IncomeReport</code> table. It sums up all the amounts for a particular date specified here as the <code>IncomeDate</code> and inserts the total into the <code>IncomeReports</code>.</p>
  
  <p>Meanwhile the <code>INsertDate</code> stored procedure checks to see if the <code>IncomeReport</code> table has the date that the 'cmmd' command intends to insert an amount under. If it doesn't, it iInserts the date gotten from the <code>IncomeDate</code> also. This then allows for the <code>UPDATEINCOME</code> to insert an amount into that table where the date is <code>@IncomeDate</code>.</p>