Summary

Chapter 7 - Updating and Deleting Records
byJohn Kauffman, Fabio Claudio Ferracchiatiet al.?
Wrox Press ?2002

In this chapter, you've learned how to provide your users with the ability to update and delete records in ASP.NET and ADO.NET.

ADO.NET offers the ability to execute an SQL statement using either a command object, or a combination of a dataset and a data adapter. When using the latter, you can either let it build update and delete commands automatically, or you can provide them for yourself. The data adapter object can examine each record in the dataset, and use the appropriate commands to push any changes to the database.

The ASP.NET DataGrid control provides users with the ability to edit records inline. Users can modify or delete records and post those actions back to the database, with ASP.NET then raising events appropriate to the user action. We can then handle each event programmatically on the server to perform the operations requested by the user.

In addition, you can validate user input and actions according to business rules. While the DataGrid control doesn't provide easy validation (as some of the other controls do), you can use one of several techniques to ensure that data validation is done before updating the database.



Beginning ASP. NET 2.0 and Databases
Beginning ASP.NET 2.0 and Databases (Wrox Beginning Guides)
ISBN: 0471781347
EAN: 2147483647
Year: 2004
Pages: 263

flylib.com © 2008-2017.
If you may any questions please contact us: flylib@qtcs.net