Data Access Application Block Overview
- Last Updated: April 16, 2026
- 3 minute read
- ADO.NET
- Documentation
The Data Access Application Block (DAAB) is designed to allow developers to replace ADO.NET boiler-plate code with standardized code for everyday database tasks. The overloaded methods in the Database class can:
- Return Scalar values.
- Determine which parameters that are needed and create them.
- Involve commands in a transaction.
If your application needs to address specific DBMS functionality, you can use a DataDirect Connect for ADO.NET data provider.
Configuring the DAAB
Before you can configure the DAAB for use with your application, you must set up the environment:
- First, make sure that you have installed Microsoft Enterprise Library 6.0.
- Then, compile the project and note the output directory.
- Open the DataDirect DAAB project for your DataDirect data provider, located in install_dir\Enterprise Libraries\Src\CS<provider>.
- Compile the project and note the output directory.
Configuring the Data Access Application Block consists of two procedures:
- Adding a New DAAB Entry
- Adding the Data Access Application Block to Your Application
Adding a New DAAB Entry
Now, use the Enterprise Library Configuration Tool to add a new DAAB entry:
-
Right-click Enterprise Library Configuration, and select New Application.
-
Right-click Application Configuration, then select New / Data Access Application Block. The Enterprise Library Configuration window appears.

-
In the Name field, enter a name for the DAAB’s connection string, for example, MyOracle.
-
In the ConnectionString field, enter a connection string.
For example, Host=ntsl2003;Port=1521;SID=ORCL1252; User ID=SCOTT;Password=TIGER;Encryption Method=SSL;AuthenticationMethod=Kerberos;
-
Right-click the ProviderName field, and select the data provider. For example, select DDTek.Oracle.4.3 for the Oracle data provider.
-
Right-click Custom Provider Mappings and select New / Provider Mappings.

-
In the Name field, select the data provider name you specified in Step 5.
-
Select the TypeName field, and then choose the browse (…) button to navigate to the Debug output directory of the DataDirect DAAB that you built. Then, select the TypeName. For example, the Oracle TypeName is DDTek.EnterpriseLibrary.Data.Oracle.dll.
-
Leave the Enterprise Library Configuration window open for now and do not save this configuration until you complete the following section.
Adding the Data Access Application Block to Your Application
To add the DAAB to a new or existing application, perform these steps:
-
Add two additional References to your Visual Studio solution:
- Enterprise Library Shared Library
- Enterprise Library Data Access Application Block
-
Add the following directive to your C# source code:
using Microsoft.Practices.EnterpriseLibrary.Data; using System.Data; -
Rebuild the solution to ensure that the new dependencies are functional.
-
Determine the output Debug or Release path location of your current solution, and switch back to the Enterprise Library Configuration window (see "Adding a New DAAB Entry").
-
Right-click the connection string under the Application Node and select Save Application.
-
Navigate to the Debug or Release output directories of your current solution, and locate the .exe file of the current solution.
-
Click the file name once, and add .config to the name, for example, MyOracle.config.
-
Ensure that Save as type 'All Files' is selected, and select Save.
-
Using File Explorer, copy the DDTek.EnterpriseLibrary.Data.XXX.dll from the DataDirect DAAB directories, where XXX indicates the data source.
-
Place the copy of this DLL into either the Debug or Release output directory of your current solution.
Using the Data Access Application Block in Application Code
Now that you have configured the DAAB, you can build applications on top of this DAAB.
In the following example, we use the DAAB MyOracle and the DatabaseFactory to generate an instance of a Database object backed by an Oracle data source.
using System;
using System.Collections.Generic;
using System.Text;
using Microsoft.Practices.EnterpriseLibrary.Data;
using System.Data;
namespace DAAB_Test_App_1
{
class Program
{
static void Main(string[] args)
{
Database database = DatabaseFactory.CreateDatabase("MyOracle");
DataSet ds = database.ExecuteDataSet(CommandType.TableDirect, "SQLCOMMANDTEST_NC_2003SERVER_1");
}
}
}
The Microsoft Enterprise Library DAAB coding patterns are now at your disposal.