title: How to insert multiple records into database with SqlParameter in C#
body: <p>I am trying to run the following code:</p>
  
  <pre><code>using (SqlConnection conn = new SqlConnection(connstr))
  {
      conn.Open();
  
      StringBuilder sqlStr = new StringBuilder("INSERT into Customers values ( @name, @address, @city, @state)");
  
      SqlCommand cmd = new SqlCommand(sqlStr.ToString(), conn);
      cmd.Parameters.Add(new SqlParameter("@name", "John Smith"));
      cmd.Parameters.Add(new SqlParameter("@address", "123 Main St."));
      cmd.Parameters.Add(new SqlParameter("@city", "Detroit"));
      cmd.Parameters.Add(new SqlParameter("@state", "Michigan"));
  
      cmd.ExecuteReader();
  
      cmd.Parameters["@name"].Value = "William Jones";
      cmd.Parameters["@address"].Value = "500 Blanchard Ave";
      cmd.Parameters["@city"].Value = "Chicago";
      cmd.Parameters["@state"].Value = "Illinois";
  
      cmd.ExecuteReader();
  }
  </code></pre>
  
  <p>However, I am getting an error. I have tried multiple other ways, but nothing seems to work. What is the proper way to insert multiple records using <code>SqlParameter</code>s?</p>