I am trying to read an excel sheet using this code
Dictionary<string, DataTable> tables = new Dictionary<string, DataTable>();//Microsoft.Jet.OLEDB.4.0
string sConnection = string.Format("Provider=Microsoft.ACE.OLEDB.12.0;Data Source={0};Extended Properties='Excel 12.0;HDR=yes'", filePath);
OleDbConnection oleExcelConnection = new OleDbConnection(sConnection);
foreach(string sheet in Sheets)
{
DataTable dt = GetDataTable("SELECT * from [" + sheet + "$]", sConnection);
tables.Add(sheet, dt);
}
After I run it got this exception The 'Microsoft.ACE.OLEDB.12.0' provider is not registered on the local machine.
and I downloaded the component from here 'https://www.microsoft.com/en-us/download/confirmation.aspx?id=23734' and worked correctly but when I deploy it it doesn't work anyone can help ?