Summary

Summary

  • ADO.NET includes five key components used for most data access: database connection, data adapter, data set, data table, and data view.

  • ADO.NET provides typed data sets. Typed data sets use explicit names and data types that help prevent errors during programming.

  • Use data binding to quickly display data sets on Web forms through the DataGrid, DataList, or other list controls.

  • Create command objects to execute SQL commands directly on a database. Command objects can return a single value (ExecuteScalar), modify the database (ExecuteNonQuery), or return data (ExecuteReader).

  • Transactions group database commands so that they succeed or fail in an all-or-nothing fashion. This ensures that changes are not partially made, thus preserving the integrity of the database.

  • To determine which commands should be included in a transaction, use the ACID test. A transaction must be atomic, consistent, isolated, and durable.

  • To use a transaction, follow these steps:

    1. Begin the transaction.

    2. Perform commands and make changes that are part of the transaction.

    3. Check for errors.

    4. If errors occurred, undo (roll back) the changes. If no errors occurred, commit the changes. This ends the transaction.

  • Manage data set transactions using the Update method to commit changes and the RejectChanges method to undo (or roll back) changes.

  • Manage database transactions using the transaction object s Commit and Rollback methods.



MCAD(s)MCSD Self-Paced Training Kit(c) Developing Web Applications With Microsoft Visual Basic. Net and Microsoft V[.  .. ]0-315
MCAD(s)MCSD Self-Paced Training Kit(c) Developing Web Applications With Microsoft Visual Basic. Net and Microsoft V[. .. ]0-315
ISBN: N/A
EAN: N/A
Year: 2003
Pages: 118

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