Entlib loads OracleClient even though provider is SqlClient

Topics: Data Access Application Block
Oct 9, 2007 at 6:49 AM
I am new to DAAB but I have just noticed that even though I have specified System.Data.SqlClient, EntLib is loading System.Data.OracleClient

Using the following app.config

<?xml version="1.0" encoding="utf-8"?>
<configuration>
<configSections>
<section name="dataConfiguration" type="Microsoft.Practices.EnterpriseLibrary.Data.Configuration.DatabaseSettings, Microsoft.Practices.EnterpriseLibrary.Data, Version=3.1.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" />
</configSections>
<dataConfiguration defaultDatabase="TestDB" />
<connectionStrings>
<add name="TestDB" connectionString="Data Source=(local);Initial Catalog=Unity;Integrated Security=True;MultipleActiveResultSets=True"
providerName="System.Data.SqlClient" />
</connectionStrings>
</configuration>

If I walk through the loaded assemblies using AppDomain.CurrentDomain.GetAssemblies() System.Data.OracleClient is loaded not the System.Data.SqlClient, although the application talks to the database OK.

It is connecting to Sql Server 2005 Developer Edition. Is this normal or am I doing something wrong.

Oct 9, 2007 at 12:34 PM
Hi,

The System.Data.OracleClient is loaded because the Database factory classes have some hardcoded references to types in this assembly for performance purposes causing the assembly to be loaded, and the SQL types reside in the System.Data assembly.

Hope this clarifies the situation,
Fernando
Oct 9, 2007 at 2:58 PM
Hi Fernando,

Many thanks for the quick response, I just wanted to make sure I wasnt going mad.

Rob