Archive

Posts Tagged ‘data access block’

Minimum configuration for data access block v5

May 27, 2011 1 comment

If you’re using the Data Access Block from Microsoft’s Enterprise Library (v5, e.g. 5.0.414.0), here is the minimum configuration you’ll need to be able to do data access:

<configuration>

<configSections>

<sectionname=dataConfigurationtype=Microsoft.Practices.EnterpriseLibrary.Data.Configuration.DatabaseSettings, Microsoft.Practices.EnterpriseLibrary.Data, Version=5.0.414.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35requirePermission=true />

</configSections>

<dataConfigurationdefaultDatabase=myDbConn>

</dataConfiguration>

<connectionStrings>

<addname=myDbConnconnectionString=data source=(local);Integrated Security= SSPI;Initial Catalog=myDatabase;providerName=System.Data.SqlClient/>

</connectionStrings>

</configuration>

Without this you’re liable to get the error: “The type Database cannot be constructed. You must configure the container to supply this value.”

-Krip

Advertisements