Enterprise Library: Your first step on DAAB

This sample code snippet gives you a kick start (Hello World ;)) on Microsoft Patterns & Practices Enterprise Library – Data Access Application Block.

Remember that there a more than one way to do most steps. I am not going to confuse you by writing all.

 

  1. First you need to download and install Enterprise Library. I used version 4.1 which is the latest at the time of writing this entry.
  2. Create a new project. I used a C# Windows application on my Visual Studio 2008 Express.
  3. Now you need to add reference to dlls
    • Microsoft.Practices.EnterpriseLibrary.Common and
    • Microsoft.Practices.EnterpriseLibrary.Data
  4. Below code does the following:
    • Create database connection. I used a SQL Server 2008 Database.
    • Execute a SELECT statement
    • Populates data to a DataGridView control

 

Enterprise Library: Your first step on DAAB

This sample code snippet gives you a kick start (Hello World ;)) on Microsoft Patterns & Practices Enterprise Library – Data Access Application Block.

Remember that there a more than one way to do most steps. I am not going to confuse you by writing all.

 

  1. First you need to download and install Enterprise Library. I used version 4.1 which is the latest at the time of writing this entry.
  2. Create a new project. I used a C# Windows application on my Visual Studio 2008 Express.
  3. Now you need to add reference to dlls
    • Microsoft.Practices.EnterpriseLibrary.Common and
    • Microsoft.Practices.EnterpriseLibrary.Data
  4. Below code does the following:
    • Create database connection. I used a SQL Server 2008 Database.
    • Execute a SELECT statement
    • Populates data to a DataGridView control