Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Unable to find the requested .Net Framework Data Provider. It may not be installed. vs 2010 and sql server 2008 express

In VS 2010 I use these steps to connect to SQL Server database:

  1. in server explorer window,Right Click on Data Connections
  2. Click Add Connection
  3. in choose data source window ,select SQL Server
  4. click continue, button
  5. "Add Connection" window will appear
  6. in the server name text box type ".\sqlexpress"
  7. in the select or enter database name type"Person"
  8. Click Test Connection -- i see "test connection successed"
  9. Finally Click OK Button

At step 9 I see this error: "Unable ti find the requested .Net Framework Data Provider It May not be Installed"

like image 640
AComputer Avatar asked Dec 16 '12 06:12

AComputer


1 Answers

There is a self terminating node in the machine.config file. Removing it solved the issue.

machine.config is found in

\Windows\Microsoft.net\Framework\vXXXX\machine.config

You could have a multitude of config files based on how many versions of the framework are installed, including 32 and 64 bit variants.

<system.data>
    <DbProviderFactories>
        <add name="Odbc Data Provider" invariant="System.Data.Odbc" ... />
        <add name="OleDb Data Provider" invariant="System.Data.OleDb" ... />
        <add name="OracleClient Data Provider" invariant="System.Data ... />
        <add name="SqlClient Data Provider" invariant="System.Data ... />
        <add name="IBM DB2 for i .NET Provider" invariant="IBM.Data ... />
        <add name="Microsoft SQL Server Compact Data Provider" ... />     
    </DbProviderFactories>

    <DbProviderFactories/>  //remove this one
</system.data>

Above file remove <DbProviderFactories/> empty tag.

For additional reading Obtaining a DbProviderFactory (ADO.NET)

I hope this will help to you.

like image 153
Sampath Avatar answered Oct 21 '22 10:10

Sampath