title: ObjectContext.ExecuteStoreCommand, how to clear parameters between calls?
body: <p>I am making multiple calls to ObjectContext.ExecuteStoreCommand with different commands and different parameters, although I use the same parameter list (object) for a several of the commands.  I am getting the following exception:</p>
  
  <p><code>System.ArgumentException: The SqlParameter is already contained by another SqlParameterCollection.</code></p>
  
  <p>Is there a way to clear parameters between calls as I would do with straight up ADO.NET?</p>
  
  <p><strong>Updated with a code sample:</strong></p>
  
  <pre><code>    string sqlDeleteWebUserGreen = "delete WebUserGreen where WebUserId = @WebUserId";
      string sqlDeleteWebUserBlue = "delete WebUserBlue where WebUserId = @WebUserId";
  
      var argsDeleteWebUserXref = new DbParameter[] {
          new SqlParameter { ParameterName = "WebUserId", Value = user.WebUserId }
  
      rowsAffectedDeleteWebUserXref += base.context.ExecuteStoreCommand(sqlDeleteWebUserGreen, argsDeleteWebUserXref);
      rowsAffectedDeleteWebUserXref += base.context.ExecuteStoreCommand(sqlDeleteWebUserBlue, argsDeleteWebUserXref);
  </code></pre>
  
  <p><strong>UPDATE</strong></p>
  
  <p>Basically I am unable to find any better way of doing this, so I ended up accepting the answer below.  The only difference is that I simply put the creation of the parameter into a separate method, so my calls look like <code>base.context.ExecuteStoreCommand(sqlDeleteWebUserBlue, MethodThatWillGiveMeTheParameterArray());</code></p>