title: How to assign default value in a parameter?
body: <p>I have the codes below that will display data from access database into textboxes of another form. </p>
  
  <pre><code>item items = new item();
  Add_Order addorder = new Add_Order();
  OleDbCommand cmd = new OleDbCommand("Select * from tblItems WHERE ItemName = @Item", connection);
  cmd.Parameters.AddWithValue("@Item", items.ItemName1);
  cmd.Connection = connection;
  connection.Open();
  
  cmd.ExecuteNonQuery();
  cmd.Parameters.AddWithValue("@ItemID", addorder.tbItemID.Text);
  cmd.Parameters.AddWithValue("@ItemName", addorder.tbName.Text);
  cmd.Parameters.AddWithValue("@ItemPrice", addorder.tbPrice.Text);
  OleDbDataReader read = cmd.ExecuteReader();
  while (read.Read())
  {
      addorder.tbItemID.Text = read[0].ToString();
      addorder.tbName.Text = read[1].ToString();
      addorder.tbPrice.Text = read[2].ToString();
  }
  addorder.ShowDialog();
  connection.Close();
  </code></pre>
  
  <p>the error says that </p>
  
  <blockquote>
    <p>Parameter @Item has no default value</p>
  </blockquote>
  
  <p>But I already assigned the value of <code>@Item</code> in this line </p>
  
  <pre><code>cmd.Parameters.AddWithValue("@Item", items.ItemName1);
  </code></pre>