Enterprse Library 4.1 Problem

May 21, 2011 at 9:35 AM

Hi all,

  I was written following for connectivity of DB,I am getting Inner exception as "Unable to find the requested .Net Framework Data Provider.  It may not be installed.". But i have installed Enterprse Library 4.1.

Please help me ,Thanks in advance

using Microsoft.Practices.EnterpriseLibrary.Common;
using Microsoft.Practices.EnterpriseLibrary.Data;
using Microsoft.Practices.EnterpriseLibrary.ExceptionHandling;
using Microsoft.Practices.EnterpriseLibrary.Logging;

public class ClassA :
    {
       Database db;
       public ClassA()
        {
        
            db = DatabaseFactory.CreateDatabase("Constr");
        }

In web.config

 <configSections>
    <section name="loggingConfiguration" type="Microsoft.Practices.EnterpriseLibrary.Logging.Configuration.LoggingSettings, Microsoft.Practices.EnterpriseLibrary.Logging, Version=4.1.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35" />
    <section name="exceptionHandling" type="Microsoft.Practices.EnterpriseLibrary.ExceptionHandling.Configuration.ExceptionHandlingSettings, Microsoft.Practices.EnterpriseLibrary.ExceptionHandling, Version=4.1.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35" />
    <section name="dataConfiguration" type="Microsoft.Practices.EnterpriseLibrary.Data.Configuration.DatabaseSettings, Microsoft.Practices.EnterpriseLibrary.Data, Version=4.1.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35" />
  </configSections>

<connectionStrings>
        <add name="Constr" connectionString="Data Source=***;Initial Catalog=***;Persist Security Info=True;User ID=sa;Password=pwd_123"
         providerName="Syste.Data.SqlClient" />
    </connectionStrings>
   <dataConfiguration defaultDatabase="Constr"/>

 

May 23, 2011 at 3:40 AM

Hi,

I just noticed that you mistyped the providerName in your connectionstrings, it should be System.Data.SqlClient

<connectionStrings>
        <add name="Constr" connectionString="Data Source=***;Initial Catalog=***;Persist Security Info=True;User ID=sa;Password=pwd_123"
         providerName="System.Data.SqlClient" />
    </connectionStrings>
   <dataConfiguration defaultDatabase="Constr"/>

 

Noel Angelo Bolasoc
Global Technologies and Solutions
Avanade, Inc.
entlib.support@avanade.com