none
Unable to find the requested .Net Framework Data Provider RRS feed

  • Question

  • I have a multi-part problem and the real problem only shows up at the bottom:

     

    1. A DLL Project named "Engine" which accesses the database via different connection types: Odbc, OleDb, and SqlClient

    2. A Windows Forms project "WinDirect" that utilizes the Engine to access the various databases.

     

    First problem: When I ran the Windows Forms project it would not connect to the SQL Server database using OleDb until I added an App.Config file to the Engine with the following lines:

     

    <system.data>

    <DbProviderFactories>

    <add name="Odbc Data Provider" invariant="System.Data.Odbc" description=".Net Framework Data Provider for Odbc" type="System.Data.Odbc.OdbcFactory, System.Data, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" />

    <add name="OleDb Data Provider" invariant="System.Data.OleDb" description=".Net Framework Data Provider for OleDb" type="System.Data.OleDb.OleDbFactory, System.Data, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" />

    <add name="OracleClient Data Provider" invariant="System.Data.OracleClient" description=".Net Framework Data Provider for Oracle" type="System.Data.OracleClient.OracleClientFactory, System.Data.OracleClient, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" />

    <add name="SqlClient Data Provider" invariant="System.Data.SqlClient" description=".Net Framework Data Provider for SqlServer" type="System.Data.SqlClient.SqlClientFactory, System.Data, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" />

    <add name="SQL Server CE Data Provider" invariant="Microsoft.SqlServerCe.Client" description=".NET Framework Data Provider for Microsoft SQL Server 2005 Mobile Edition" type="Microsoft.SqlServerCe.Client.SqlCeClientFactory, Microsoft.SqlServerCe.Client, Version=9.0.242.0, Culture=neutral, PublicKeyToken=89845dcd8080cc91" />

    </DbProviderFactories>

    </system.data>

     

    I do not understand whay I had to add the above since I had the "Imports" statements in the Engine code as follows:

    Imports System.Data

    Imports System.Data.Odbc

    Imports System.Data.OleDb

    Imports System.Data.SqlClient

    Imports System.Data.OracleClient

     

    Anyway, at this point I could connect to the SQL Server database with either OleDb or SqlClient but still would like to lknow why.

     

    Now comes the fun part:

     

    3. I created a new Web Service project "dgWs" and have a single method identical to the single method on the "Engine". This Web Service references the "Engine" and is no more than a simple pass-through to the "Engine".

     

    4. I then created a new Windows Forms application "wsWin" that referenced the Web Service but is identical to the "WinDirect" in every other respect.

     

    The "wsWin" project worked for connecting with both SqlClient and OleDb as long as I run within the Solution.

     

    When I publish the Web Service "dgWs" and change the Web Reference in the "wsWin" to reference the published Web Service I can only connect to SQL Server via the SqlClient. It fails on connecting to the SQL Server via the OleDb provider with the message "Unable to find the requested .Net Framework Data Provider".

     

    Please help... this is driving me crazy.

     

    Thanks,

     

    Kurt

    Saturday, June 23, 2007 3:29 PM