Click here to Skip to main content
15,902,492 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
When i run the oleDB connection Following error occurs .

Argument Exception was unhandled:
The .Net Framework Data Provider for OLEDB (System.Data.OleDb) does not support the Microsoft OLE DB Provider for ODBC Drivers (MSDASQL). Use the .Net Framework Data Provider for ODBC (System.Data.Odbc).

Please help.

Thank You in advance.

What I have tried:

private void btnOk_Click(object sender, EventArgs e)
{

connect = txtConnString.Text.ToString();
OleDbConnection ccon = new OleDbConnection(connect);
ccon.Open();
string qry = txtQuery.Text.ToString();
var f = qry.Split('*');
var g = f[1];
var cv = g.Split(' ');
v = cv[2];

OleDbDataAdapter da = new OleDbDataAdapter("SELECT * FROM [" + v.ToString() + "$]", ccon);
DataTable dt = new DataTable();
da.Fill(dt);
grdDataPrev.DataSource = dt;
ccon.Close();

}
Posted
Updated 30-Oct-17 21:21pm

 
Share this answer
 
Comments
Member 13462531 31-Oct-17 6:27am    
This update is only supported on Windows 2003 SP1 and Windows 2003 SP2 64-Bit OS.
Mine is Windows 8.1.
The error message is very explicit: it even tells you exactly what you have to do to fix it!
Quote:
The .Net Framework Data Provider for OLEDB (System.Data.OleDb) does not support the Microsoft OLE DB Provider for ODBC Drivers (MSDASQL). Use the .Net Framework Data Provider for ODBC (System.Data.Odbc).
If you still can;t work it out, see here: Support.Microsoft: Error message when you try to use the OleDbConnection.Open method: "The .Net Data OLE DB Provider(System.Data.Oledb) does not support the MSDASQL Provider, Microsoft OLE DB Provider for ODBC Drivers."[^]
 
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