Validating business rules
Take a moment to create the following classes and methods using the concepts from the example above: [System. We'll be discussing the Object Data Source in greater detail in the following tutorials. The List of Products Is Displayed in a Grid View Field-level validation are checks that pertains to the property values of the business objects when inserting or updating.Some field-level validation rules for products include: columns.In addition to enforcing these rules at the database they should also be enforced at the Data Set level.In fact, the field length and whether a value is required or optional are already captured for each Data Table's set of Data Columns.
To more cleanly separate the DAL- and BLL-related classes, let's create two subfolders in the Folder Next, let's add methods to each of the classes to simply wrap the methods defined for the Table Adapters from the first tutorial. Rather, to indicate that a particular Data Column in a Data Row should correspond to a .Using this technique we can create a The BLL classes should contain checks to ensure adherence to the application's business rules.These checks can be added directly to the methods to which they apply. reorder Level, bool discontinued, int product ID) As we'll see in future tutorials, handling exceptions that bubble up from the BLL when using a data Web control for inserting, updating, or deleting data can be handled directly in an event handler as opposed to having to wrap code in blocks.However, using this technique does not allow us to override existing methods nor does it separate our DAL and our BLL as cleanly as the approach we've taken in this article.With the DAL and BLL complete, we're ready to start on our presentation layer. NET books and founder of 4Guys From Rolla.com, has been working with Microsoft Web technologies since 1998.