I have a problem because I am trying to read an excel (xls), with the OLEDB, I already install the driver but it does not load the file, this is the error that indicates me.
This is my code.
try {
// CargaMasiva
string connectString =@"Provider=Microsoft.ACE.OLEDB.12.0;
Data Source=C:\CargaMasivaInventario.xls;Extended Properties='Excel 8.0;HDR=YES;'";
OleDbConnection conn = new OleDbConnection(connectString);
OleDbDataAdapter da = new OleDbDataAdapter("Select * From [CargaMasiva]", conn);
DataTable dt = new DataTable();
da.Fill(dt);
dataGridView1.DataSource = dt;
}
catch (Exception ex) {
Debug.Print(ex.Message);
MessageBox.Show(ex.Message);
}
It is called when I call a button. It seems that the sheet does not call me, CargaMasiva
These are the excel sheets .. and it is called as indicated in the connection string.
already install the driver, what is not, if the driver is necessary for it to work? thanks!