Click here to Skip to main content
15,881,812 members
Please Sign up or sign in to vote.
1.00/5 (1 vote)
See more:
The 'Microsoft.Jet.OLEDB.12.0' provider is not registered on the local machine.

What I have tried:

The 'Microsoft.Jet.OLEDB.12.0' provider is not registered on the local machine.
OleDbConnection cnn = new OleDbConnection(@"Provider=Microsoft.Jet.OLEDB.4.0;Data Source=" + paths + "; Extended Properties=Excel 12.0;IMEX=1;HDR=YES;");
OleDbCommand oconn = new OleDbCommand("select * from [Sheet1$]", cnn);
cnn.Open();
OleDbDataAdapter adp = new OleDbDataAdapter(oconn);
DataTable dt = new DataTable();
adp.Fill(dt);
if (dt.Rows.Count > 0)
{
var username = dt.Rows[0]["username"].ToString();
var id = dt.Rows[0]["id"].ToString();
var password = dt.Rows[0]["password"].ToString();

}
Posted
Updated 22-Jul-18 20:21pm
Comments
Mycroft Holmes 23-Jul-18 2:16am    
Do some research into the availability of the Jet engine and find out if you have a 64bit machine.

1 solution

Consider moving to the ACE db engine instead of Jet - it's newer, and supports 64 bit machines and code, which Jet doesn't. If you are running as x64 for any reason - and you probably are - then you cannot access 32 bit code at all, so Jet will not be available to you.
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900