title: Importing Excel File to DataGridView
body: <pre><code>OpenFileDialog ofImport = new OpenFileDialog();
  ofImport.Title = "Select file";
  ofImport.InitialDirectory = @"c:\";
  ofImport.FileName = txtFileName.Text;
  ofImport.Filter = "Excel Sheet(*.xlsx)|*.xlsx|All Files(*.*)|*.*";
  ofImport.FilterIndex = 1;
  ofImport.RestoreDirectory = true;
  
  if (ofImport.ShowDialog() == DialogResult.OK)
  {
  
       string path = System.IO.Path.GetFullPath(ofImport.FileName);
       string query = "SELECT * FROM Customer.xlsx";
       OleDbConnection conn = new OleDbConnection();
       conn.ConnectionString = @"Provider=Microsoft.ACE.OLEDB.12.0;Data Source="+ofImport.FileName+";Extended Properties=" + "\"Excel 12.0 Xml;HDR=YES;IMEX=1\"";
       OleDbDataAdapter adapter = new OleDbDataAdapter(query, conn);
  
       //DataSet dataSet = new DataSet();
       adapter.Fill(dsSource);
       dataGridView1.DataSource = dsSource;
  
  }
  else
  {
       ofImport.Dispose();
  }   
  </code></pre>
  
  <p>I want to retrive Excel data to the <code>DataGridView</code> using <code>dataset</code>. <code>dsSource</code> is the dataset used.</p>
  
  <p>The Error I'm obtaing is on the line <code>adapter.Fill(dsSource);</code>:</p>
  
  <blockquote>
    <p>The Microsoft Access database engine could not find the object 'xlsx'.
    Make sure the object exists and that you spell its name and the path
    name correctly. If 'xlsx' is not a local object, check your network
    connection or contact the server administrator.</p>
  </blockquote>
  
  <p>I'm able to select the file but it is not Filling in dataset.</p>
  
  <p>What to do?</p>