title: Reading multiple excel sheets with different worksheet names
body: <p>I would like to know how I can read multiple excel worksheet with different worksheet name in c# and with the used of oledb.</p>
  
  <p>I have this existing way to read multiple sheets (but with fixed worksheet name):</p>
  
  <pre><code>DataSet ds = new DataSet();
  var excelConnectionString = string.Format("Provider=Microsoft.Jet.OLEDB.4.0;Data Source={0};Extended Properties=Excel 8.0", path); 
  OleDbConnection connection = new OleDbConnection();
  connection.ConnectionString = excelConnectionString;
  
  var i = 1;
  while (i &lt;= 4)
  {
      string query = "SELECT * FROM [Sheet" + i + "$]";
      ds.Clear();
      OleDbDataAdapter data = new OleDbDataAdapter(query, connection);
      data.Fill(ds);
  
      // other stuff
      i = i + 1;
  }
  </code></pre>
  
  <p>This one works. But I'm now in different situation wherein the worksheets names are not fixed, example: Sheet1 is Dog, Sheet2 is Cat Sheet3 is Bird.</p>
  
  <p>Now my concern is how I can loop on those worksheet names with the use of my existing code.</p>