I have the following code snippet that connects to Excel, however it returns me the error:
string sFileXLSX = ConfigurationManager.AppSettings["ExportPerformanceEntrega"];
string strConnXLSX = "Provider=Microsoft.ACE.OLEDB.12.0;Data Source='" + sFileXLSX + "';Extended Properties=Excel 12.0;";
using (OleDbConnection conn = new OleDbConnection(strConnXLSX))
{
//SQL para fazer o Delete
string strSQL = "DELETE FROM [Base Entregue1$]";
//Criando o OleDbCommand com o SQL e a conexão
OleDbCommand cmd = new OleDbCommand(strSQL, conn);
//Abrindo a conexão
conn.Open();
//Executando o Delete
cmd.ExecuteNonQuery();
//Fechando a conexão
conn.Close();
}
Microsoft.ACE.OLEDB.12.0 'provider is not registered on the local machine
But I already installed the Microsoft Access Database Engine 2010 Redistributable file that was meant to fix this error and even though it contained this exception
.