activation error occured while trying to get instance of type database key through connectionstring

Topics: Data Access Application Block, Enterprise Library Core, General discussion
Mar 19, 2015 at 5:05 PM
Edited Mar 25, 2015 at 1:21 PM
When calling this property, I am receive error activation error occured while trying to get instance of type database key through connectionstring.
I am using Enterprise Library 5.0

Visual Studio 2010 and .Net Framework 4.0
IIS version 7.5
public static Database Database
        return DatabaseFactory.CreateDatabase();
relevant part of web.config --

<section name="loggingConfiguration" type="Microsoft.Practices.EnterpriseLibrary.Logging.Configuration.LoggingSettings, Microsoft.Practices.EnterpriseLibrary.Logging, Version=5.0.414.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35" requirePermission="true"/>
<section name="dataConfiguration" type="Microsoft.Practices.EnterpriseLibrary.Data.Configuration.DatabaseSettings, Microsoft.Practices.EnterpriseLibrary.Data, Version=5.0.414.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35" requirePermission="true"/></configSections>

<dataConfiguration defaultDatabase="Q"/>

<add name="Q" connectionString="Data Source=DV;Initial Catalog=QUA;UID=sa;pwd=AAA" providerName="System.Data.SqlClient"/>
<add name="T" connectionString="Data Source=DV;Initial Catalog=QuanT;UID=sa;pwd=AAA" providerName="System.Data.SqlClient"/>
<add name="P" connectionString="Data Source=DV;Initial Catalog=QuaP;UID=sa;pwd=AAA" providerName="System.Data.SqlClient"/></connectionStrings>

please note same code work perfectly fine all the time when executing through Visual Studio Built in Web Server but when I published in IIS and executing through IIS, I got this error..
Mar 19, 2015 at 5:25 PM
The type Database cannot be constructed. You must configure the container to supply this value.