title: C# Run a procedure without specifying a parameter name
body: <p>How can I execute a stored procedure that takes in parameters without having to specify the prameters name? The name of the parameter in the stored procedure may change from CustomerID to CustID so I don't want to have to keep changing my code.</p>
  
  <p>Rather than doing what is provided below where you specify the parameter name - </p>
  
  <pre><code>command.Parameters.Add("@dtStart", SqlDbType.DateTime);
  command.Parameters["@dtStart"].Value = startDate;
  command.Parameters.Add("@CustomerID", SqlDbType.NChar);
  command.Parameters["@CustomerID"].Value = customerID;
  </code></pre>
  
  <p>I am looking to do something like this -</p>
  
  <pre><code>command.Parameters.Add(startDate, customerID);
  </code></pre>