title: Selecting a range in a worksheet C#
body: <p>I currently have the following code opening and reading in an excel spreadsheet:</p>
  
  <pre><code>var connectionString = string.Format("Provider=Microsoft.ACE.OLEDB.12.0;Data Source={0};Extended Properties=Excel 12.0;", fileNameTextBox.Text);
  var queryString = String.Format("SELECT * FROM [{0}]",DETAILS_SHEET_NAME);
  var adapter = new OleDbDataAdapter(queryString, connectionString);
  var ds = new DataSet();
  
  adapter.Fill(ds, DETAILS_SHEET_NAME);
  
  DataTable data = ds.Tables[DETAILS_SHEET_NAME];
  
  dataGridView1.DataSource = data;
                  dataGridView1.AutoResizeColumns(DataGridViewAutoSizeColumnsMode.AllCellsExceptHeader);
  </code></pre>
  
  <p>This is all good and well except I'm not interested in the first row (Possibly first two rows as row 2 is headers) of the worksheet. How can I modify the select Query to select a range like I would in excel?</p>
  
  <p>I'm interested in reading in say columns A-N in rows all rows from 2 onwards that contain data.</p>
  
  <p>I also need to access a couple of specific cells on a different worksheet, I assume I have to build another adaptor with a different query string for each of those cells?</p>