title: OleDbParameters and Parameter Names
body: <p>I have an SQL statement that I'm executing through OleDb, the statement is something like this:</p>
  
  <pre><code>INSERT INTO mytable (name, dept) VALUES (@name, @dept);
  </code></pre>
  
  <p>I'm adding parameters to the OleDbCommand like this:</p>
  
  <pre><code>OleDbCommand Command = new OleDbCommand();
  Command.Connection = Connection;
  
  OleDbParameter Parameter1 = new OleDbParameter();
  Parameter1.OleDbType = OleDbType.VarChar;
  Parameter1.ParamterName = "@name";
  Parameter1.Value = "Bob";
  
  OleDbParameter Parameter2 = new OleDbParameter();
  Parameter2.OleDbType = OleDbType.VarChar;
  Parameter2.ParamterName = "@dept";
  Parameter2.Value = "ADept";
  
  Command.Parameters.Add(Parameter1);
  Command.Parameters.Add(Parameter2);
  </code></pre>
  
  <p>The problem I've got is, if I add the parameters to command the other way round, then the columns are populated with the wrong values (i.e. name is in the dept column and vice versa)</p>
  
  <pre><code>Command.Parameters.Add(Parameter2);
  Command.Parameters.Add(Parameter1);
  </code></pre>
  
  <p>My question is, what is the point of the parameter names if parameters values are just inserted into the table in the order they are added command? The parameter names seems redundant?</p>