title: Reading Excel 2010 file - cells in C#
body: <p><strong>UPDATE 2</strong></p>
  
  <pre><code>string connectionString = String.Format(@"Provider=Microsoft.ACE.OLEDB.12.0;Data Source={0};Extended Properties=""Excel 8.0;HDR=YES;IMEX=1;""", EXCELFILENAME);
  
              string testCaseName = "test_case_2";
  
              string query = String.Format("SELECT * from [{0}$] WHERE columns={1}", workbookName, testCaseName);
  
              OleDbDataAdapter dataAdapter = new OleDbDataAdapter(query, connectionString);
  
              DataSet dataSet = new DataSet();
              dataAdapter.Fill(dataSet); //&lt;&lt;ERROR 
  
          DataTable myTable = dataSet.Tables[0]; 
  </code></pre>
  
  <p>ERROR:
  No value given for one or more required parameters.</p>
  
  <p><strong>UPDATE END</strong></p>
  
  <p><strong>UPDATE:</strong></p>
  
  <pre><code>string connectionString = String.Format(@"Provider=Microsoft.ACE.OLEDB.12.0;Data Source={0};Extended Properties=""Excel 8.0;HDR=YES;IMEX=1;""", EXCELFILENAME);
              string query = String.Format("select * from [{0}$]", workbookName);
  
              OleDbDataAdapter dataAdapter = new OleDbDataAdapter(query, connectionString);               
              DataSet dataSet = new DataSet();
              dataAdapter.Fill(dataSet);
  
              DataTable myTable = dataSet.Tables[0];
  </code></pre>
  
  <p>How to read data from cells and store it in array/string. I have done reading worksheet but can't find any better of doing</p>
  
  <p>so here is my excel sheet looks like:</p>
  
  <p><img src="https://i.stack.imgur.com/5iT5e.png" alt="enter image description here"> </p>
  
  <p>I should be able to pass the column in my case test_case_1 or test_case_2 etc... and read the columns for that particular row....</p>