title: The parameterized query expects the parameter '@Id', which was not supplied
body: <p>I am writing a software I use method (parameters.add) but when I am adding data to a database I get the error below:</p>
  
  <blockquote>
    <p>The parameterized query expects the parameter '@Id', which was not
    supplied.</p>
  </blockquote>
  
  <p>I saw several topic but I can't solve my problem.</p>
  
  <p><a href="https://stackoverflow.com/questions/4687189/the-parameterized-query-expects-the-parameter-which-was-not-supplied">The parameterized query expects the parameter ###### which was not supplied</a></p>
  
  <p><a href="https://stackoverflow.com/questions/33993251/the-parameterized-query-expects-the-parameter-which-was-not-supplied">The parameterized query expects the parameter , which was not supplied</a></p>
  
  <p>I put c# code and stored procedure code below:</p>
  
  <pre><code>private void btnSave_Click(object sender, EventArgs e)
          {
              string cs = "Integrated Security=SSPI;Persist Security Info=False;Initial Catalog=TranscactionAccountNumber;Data Source=DESKTOP-5DJFFQP";
              string name = txtName.Text;
              int shomarepeygiri = int.Parse(txtShomarePeygiri.Text);
              string date = dtpDate.Shamsi;
              decimal mablagh = decimal.Parse(txtMablagh.Text);
              string comment = txtComment.Text;
              using (cn = new SqlConnection(cs))
              using (cmd = new SqlCommand("InsertTransaction", cn))
              {
                  cmd.Parameters.Add("@Id",SqlDbType.Int);
                  cmd.Parameters.Add("@Name", SqlDbType.NVarChar, 100).Value = name;
                  cmd.Parameters.Add("@ShomarePeygiri", SqlDbType.Int).Value = shomarepeygiri;
                  cmd.Parameters.Add("@Mablagh", SqlDbType.Decimal).Value = mablagh;
                  cmd.Parameters.Add("@Comment", SqlDbType.NVarChar).Value = comment;
                  cmd.Parameters.Add("@Date", SqlDbType.VarChar).Value = date;
                  if (cn.State == ConnectionState.Closed)
                      cn.Open();
                  cmd.ExecuteNonQuery();
                  MessageBox.Show("Transaction Added Successfully..", "Register Transaction", MessageBoxButtons.OK, MessageBoxIcon.Information);
              }
  
  
          }
  </code></pre>
  
  <hr>
  
  <pre><code>Create procedure InsertTransaction
  (
  @id int,
  @Name nvarchar(100),
  @ShomarePeygiri int,
  @Mablagh decimal(18, 0),
  @Comment nvarchar(MAX),
  @PersianDate varchar(10)
  
  ) 
  AS
  Insert Into TransactionTable(id,[Name],ShomarePeygiri,Mablagh,Comment,PersianDate)
   values (@id,@Name,@ShomarePeygiri,@Mablagh,@Comment,@PersianDate)
  </code></pre>