title: Reading Excel with OleDbDataReader - cannot read values from a specific column
body: <p>I'm working on an existing C# code reading Excel file with OleDbDataReader. But I can't have the content for the cells in two specific columns.</p>
  
  <p>This is the connection code:</p>
  
  <pre><code>connection = new OleDbConnection(@"Provider=Microsoft.ACE.OLEDB.12.0;Data Source=" 
                  + pathExcel + ";Extended Properties=\"Excel 12.0;HDR=YES;IMEX=1\";");
  connection.Open();
  </code></pre>
  
  <p>And to access the content of the default sheet:</p>
  
  <pre><code>tables = connection.GetOleDbSchemaTable(OleDbSchemaGuid.Tables, null);  
  sheetsNames = from DataRow row in tables.Rows select row["TABLE_NAME"].ToString();
  sql = "SELECT * FROM [" + sheetsNames.FirstOrDefault() + "];";
  ocmd = new OleDbCommand(sql, connection);
  reader = ocmd.ExecuteReader(); //OleDbDataReader
  </code></pre>
  
  <p>So, finally I read all the content, but for some columns I can't access cells content (reader["mycolumn"]). So, I tried this:</p>
  
  <pre><code>while (reader.Read()){
     // Test code, I tried different ways to read cell content
     // It's working
     string colName = reader.GetName(26);
     string val1 = reader[colName].ToString();
     string val2 = reader.GetValue(26).ToString();
  
     // Same code, changing index 26 to 27
     ... // always empty values. Bug ??
  }
  </code></pre>
  
  <p>If I evaluate expressions "reader.GetValue(26)" it returns the expected value, but when it's "reader.GetValue(27)" it's returns an exception ("This expression causes side effects and will not be evaluated"), in particular it's like an index out of range exception. But I can read data from next columns (29, 30...). </p>
  
  <p>Do you have any idea about the cause ?</p>