Working with Data in ASP.NET 2.0 Handling BLL and DAL Level Exceptions in an ASP.NET Page

Working with Data in ASP.NET 2.0  Handling BLL and DAL Level Exceptions in an ASP.NET PageWorking with data from an ASP.NET web application using a tiered application architecture involves the following three general steps:
1. Determine what method of the Business Logic Layer needs to be invoked and what parameter values to pass it. The parameter values can be hard coded, programmatically assigned, or inputs entered by the user.
2. Invoke the method.
3. Process the results. When calling a BLL method that returns data, this may involve binding the data to a data Web control. For BLL methods that modify data, this may include performing some action based on a return value or gracefully handling any exception that arose in Step 2.


Step 1: Creating an Editable GridView of Products
In the previous tutorial we created an editable GridView with just two fields, ProductName and UnitPrice. This required creating an additional overload for the ProductsBLL class’s UpdateProduct method, one that only accepted three input parameters (the product’s name, unit price, and ID) as opposed a parameter for each product field. For this tutorial, let’s practice this technique again, creating an editable GridView that displays the product’s name, quantity per unit, unit price, and units in stock, but only allows the name, unit price, and units in stock to be edited.

To accommodate this scenario we’ll need another overload of the UpdateProduct method, one that accepts four parameters: the product’s name, unit price, units in stock, and ID. Add the following method to the ProductsBLL class:

Website: static.asp.net | Filesize: 600kb
No of Page(s): 13
Click here to download Working with Data in ASP.NET 2.0 Handling BLL and DAL Level Exceptions in an ASP.NET Page.

Related Copyrighted Books
Visual Studio Hacks: Tips & Tools for Turbocharging the IDEVisual Studio Hacks: Tips & Tools for Turbocharging the IDE
Distributed Data Applications with ASP.NET, Second EditionDistributed Data Applications with ASP.NET, Second Edition
Pro ASP.NET for SQL Server: High Performance Data Access for Web Developers (Proffesional Reference Series)Pro ASP.NET for SQL Server: High Performance Data Access for Web Developers (Proffesional Reference Series)
ASP.NET Data Web Controls Kick StartASP.NET Data Web Controls Kick Start
Hacking the Code: ASP.NET Web Application SecurityHacking the Code: ASP.NET Web Application Security

Related Tutorial

Tags: , , ,

Comments

Leave a Reply