Developing ASP.NET 2.0 Applications with the Microsoft Data Access Application Block
(Page 1 of 5 )
This is the first article in a series focusing on developing applications using ASP.NET 2.0 and the Data Access Application Block available in the Microsoft Enterprise Application Block Library for .NET 2.0. In this article, I introduce you to the concept of application blocks and develop a simple application using a data access application block with ASP.NET 2.0
A downloadable file for this article is available
here.
The entire source code for this article is available in the form of a downloadable zip file. The solution was developed using Microsoft Visual Studio 2005 Professional Edition on Microsoft Windows Server 2003 Enterprise Edition together with Microsoft SQL Server 2005 Developer Edition and Microsoft Enterprise Library for .NET Framework 2.0 (January 2006 version). I didn’t really test the solution with any other/previous editions. If you have any problems in executing the solution, please post in the discussion area.
What exactly are application blocks?
A simple definition for an application block would be "a collection of reusable, configurable and extensible units of code for application development." Let us go through a detailed explanation of the above.
Any developer who works with ADO.NET would certainly define his own data access layer (DAL). This DAL would generally work with one or more .NET data providers and provide the necessary interfaces to deal with the data existing in databases. The most commonly used interfacing within DAL would be as follows:
- Execute a SQL command.
- Return a data table/data set based on the SELECT statement given.
- Update datasets.
- Execute stored procedures.
- Return a row/value based on the select statement given.
- Logging.
If you ever develop something like the above, you have already started developing your own "application block!" Before developing an application block, you really need to design it carefully with lots of analysis. You can call your DAL library as a full-fledged application block, if you make it configurable, reusable and extensible.
Once an application block is developed, you can use it for any number of applications regardless of any domain or the type of application. You can even develop your own application blocks concentrating on only web development, smart client development, etc. It all depends on the analysis of its reusability among several applications.
You can develop these types of application blocks together with .NET enterprise services to make them more robust. .NET enterprise services include COM+, remoting, web services, MSMQ (Message Queuing), WMI, Windows services, and so on.
If you are new to developing simple data access layers/helpers, you can refer to my series “Developing a Data Access Layer for Sybase using ADO.NET.” If you are interested in developing data access helpers using COM+, the following contributions of mine may help you:
http://www.aspfree.com/c/a/MS-SQL-Server/Developing-Your-Own-SQL-Server-
Based-Data-Access-Helper-using-COM-and-VBNET/
http://www.aspfree.com/c/a/MS-SQL-Server/Completing-Your-Own-SQL-Server-
Based-Data-Access-Helper-using-COM-and-VBNET/
http://www.aspfree.com/c/a/MS-SQL-Server/A-Wrapper-Class-for-the-SQL-Server-
Based-Data-Access-Helper/
Next: What are Microsoft Enterprise Application Blocks? >>
More ASP.NET Articles
More By Jagadish Chaterjee