title: Datagridview using excel file as datasource in c#
body: <p>I am trying read an excel file and once read, want to have it as a datasource for a gridview.</p>
  
  <p>I have following code, the datatable gets populated fine, 
  But some reason, it doesn't refresh the gridview. Not sure why, can someone help please?</p>
  
  <pre><code>string connPath = "Provider=Microsoft.ACE.OLEDB.12.0;Data Source=" + path + ";ExtendedProperties = \"Excel 8.0;HDR=Yes;\";"; 
  OleDbConnection conn = new OleDbConnection(connPath); 
  OleDbDataAdapter adapter = new OleDbDataAdapter("SELECT * FROM ["+aSheet+"$]", conn);
  
  DataTable dt = new DataTable();
  
  adapter.Fill(dt); 
  aGridView.DataSource = dt; 
  aGridView.DataBind(); 
  </code></pre>