Working with Stored Procedures using ASP.NET 2.0 with Microsoft Data Access Application Block
(Page 1 of 6 )
This is the fourth article in a series focusing on developing applications using ASP.NET 2.0 and the Data Access Application Block available in “Microsoft Enterprise Application Block Library for .NET 2.0.” In this article, I shall go through the routines most used (with simple examples) for working with stored procedures in a Microsoft SQL Server database.
If you are new to Microsoft application blocks, I strongly suggest you refer to my first article in this series titled “Developing ASP.NET 2.0 Applications with the Microsoft Data Access Application Block.” It gives a solid foundation for beginners.
If you do not know how to select and use the proper “database” class, I suggest you go through my second article in this series titled “Connecting to Different Databases using ASP.NET 2.0 with the Microsoft Data Access Application Block.” In this article, I focus on working with Microsoft SQL Server.
Setting up the environment for this contribution
Before we begin, modify your web.config in such a way that it looks something like the following:
<configuration>
<appSettings/>
<connectionStrings>
<add name="AdventureWorks" connectionString="Database=
AdventureWorks;Server=(local)SQL2k5;Integrated Security=SSPI;" providerName="System.Data.SqlClient"/>
</connectionStrings>
As I wanted to demonstrate stored procedures which don’t have data in AdventureWorks, I created a table named “emp” with the following columns and data types:
- Empno (int)
- Ename (nvarchar(50))
- Sal (float)
- Deptno (int)
I pushed the following sample rows into that table:

Next: Executing a stored procedure from ASP.NET 2.0 using the Data Access Application Block >>
More ASP.NET Articles
More By Jagadish Chaterjee