title: how to get data from datatable using column name
body: <p>i have a situation where i load a dataset with excel file.  All the worksheet are loaded as datatable with the appropriate worksheet name as datatable name.  What i am trying to do is get this datatable value using column name.  But i am not get error saying</p>
  
  <p>"Column 'Execute' does not belong to table Sheet1".</p>
  
  <p>While loaded excel to datatabel i have used HDR=YES and IMEX=1.  I also tried with HDR=NO. nothing is working. </p>
  
  <p>below code is to write excel to datatable</p>
  
  <pre><code>foreach (Microsoft.Office.Interop.Excel.Worksheet wsheet in workbook.Worksheets)
  {
  
      string sql1 = "SELECT * FROM [" + wsheet.Name + "$]";
      OleDbCommand selectCMD1 = new OleDbCommand(sql1, SQLConn);
      SQLAdapter.SelectCommand = selectCMD1;
  
      SQLAdapter.Fill(dataset.Tables.Add(wsheet.Name));
  
   }
  </code></pre>
  
  <p>Data from excel loads to each sheet perfectly. but fetching it by column name is the problem. </p>
  
  <p>any suggestions please</p>