title: OleDbParameterCollection has no constructor defined
body: <p>In my project, I have a DBAdapter class that deals with database queries. </p>
  
  <pre><code>public class DBAdapter
  {
      private OleDbConnection _connection;
  
      private void _Connect()
      {
          this._connection = new OleDbConnection();
          _connection.ConnectionString = ConfigurationManager.AppSettings["Accessconnection"];
          _connection.Open();
      }
  
      private void _Disconnect()
      {
          _connection.Close();
      }
  
  
      public DataTable Select(string query, OleDbParameterCollection parameters = null)
      {
  
          OleDbCommand cmd = new OleDbCommand();
          OleDbDataAdapter dataAdapter = new OleDbDataAdapter();
          DataSet dataSet = new DataSet();
          DataTable dataTable = new DataTable();
          query = "SELECT " + query;
  
          if (parameters != null)
          {
              foreach (OleDbParameter parameter in parameters)
              {
                  cmd.Parameters.Add(parameter);
              }
          }
  
          this._Connect();
          cmd.Connection = _connection;
          cmd.CommandText = query;
  
          if (parameters != null)  {
              cmd.Prepare();
          }
          dataAdapter.SelectCommand = cmd;
          dataAdapter.Fill(dataSet, "results");
          this._Disconnect();
  
          dataTable = dataSet.Tables["results"];
          return dataTable;
      }
  
  }
  </code></pre>
  
  <p>In order to perform prepared queries, the Select method has an optionnal OleDBParameterCollection parameter. 
  Then, I have multiple Mappers for each domain object in my project, for example UserMapper, that use DataAdapter class to run queries (for example find user by id).  </p>
  
  <pre><code>    public class UserMapper : DataMapperAbstract
          {
  
              public User findByID(int id)
              {
                  User user = new User()
                  string query = "* FROM USER WHERE idUser = ?";
                  OleDbParameterCollection parameters = new OleDbParameterCollection();
                  parameters.Add(new OleDbParameter("idUser", OleDbType.Integer).Value = id);
  
                  // Prepared query
                  DataTable results = adapter.Select(query, parameters);
                  this._populateData(user, results.Rows[0]);
                  return user;
              }
      }
  </code></pre>
  
  <p>Unfortunately, I have an error at this line </p>
  
  <pre><code>   OleDbParameterCollection parameters = new OleDbParameterCollection();
  </code></pre>
  
  <p>VS says that the type OleDbParameterCollection has no constructor defined, and I don't really understand what is the problem here. Maybe I don't have rights to instantiate OleDbParameterCollection, but in that case, how should I pass a collection of parameters to my DBAdapter's method ? </p>