I'm getting the following error
"The 'Microsoft.ACE.OLEDB.12.0' provider is not registered on the local machine."
while reading the data from Excel file using OLEDB Data Reader.
Its not working in both 32 and 64 bit machine. Currently my machine having MS office 2013 and VS 2010.
string Connection = "Provider=Microsoft.ACE.OLEDB.12.0;Data Source=" + fileName + ";Extended Properties=\"Excel 12.0;HDR=YES;IMEX=1;MAXSCANROWS=15;READONLY=FALSE\"";
OleDbConnection con = new OleDbConnection(Connection);
OleDbCommand command = new OleDbCommand();
DataSet ds = new DataSet();
command.CommandText = sql;
command.CommandType = CommandType.Text;
command.Connection = con;
command.Connection.Open();
OleDbDataReader dr = command.ExecuteReader(CommandBehavior.CloseConnection);