Home > .NET, SQL Server > Minimum configuration for data access block v5

Minimum configuration for data access block v5

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
  1. john abercrombie
    June 14, 2011 at 12:34 pm

    I never thought I would agree with this option.

  1. No trackbacks yet.

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

%d bloggers like this: