2
I have the following code snippet that connects to Excel, but returns 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
However I already installed the file Microsoft Access Database Engine 2010 Redistributable that was to fix this error and still contained returning this exception
.
Agusto Strangely it really worked.
– Igor Carreiro
What a good guy! :)
– Lucas Augusto