Skip to main content

Code Behind Database Operations

  • Chapter
  • First Online:
Book cover Essential ASP.NET Web Forms Development
  • 1262 Accesses

Abstract

There are many times when it is necessary to establish a connection to a database and execute SQL commands against that database from the code behind of a page. For example, we may require the end user to click a Display button to display the contact information of his or her organization’s customers in a non-data-bound control like a multiline text box. Or we may require the end user to enter his or her login credentials and click a Login button to gain access to their application’s functionality. In both of these scenarios, we would need a page that interacts with a database from the button Click event handler method in the page’s code behind.

This is a preview of subscription content, log in via an institution to check access.

Access this chapter

Chapter
USD 29.95
Price excludes VAT (USA)
  • Available as PDF
  • Read on any device
  • Instant download
  • Own it forever
eBook
USD 59.99
Price excludes VAT (USA)
  • Available as EPUB and PDF
  • Read on any device
  • Instant download
  • Own it forever
Softcover Book
USD 79.99
Price excludes VAT (USA)
  • Compact, lightweight edition
  • Dispatched in 3 to 5 business days
  • Free shipping worldwide - see info

Tax calculation will be finalised at checkout

Purchases are for personal use only

Institutional subscriptions

Notes

  1. 1.

    A SQL Server instance is a complete SQL Server service with its own databases, credentials, and so forth. A computer can have more than one SQL Server instance installed and running at one time.

  2. 2.

    All property, method, and event descriptions were taken directly from Microsoft’s official documentation. The event handler methods used to handle the events of this class were omitted to conserve space. See the reference for all of the methods of this class.

  3. 3.

    All property, method, and event descriptions were taken directly from Microsoft’s official documentation. The event handler methods used to handle the events of this class were omitted to conserve space. See the reference for all of the methods of this class.

  4. 4.

    All property, method, and event descriptions were taken directly from Microsoft’s official documentation. The event handler methods used to handle the events of this class were omitted to conserve space. See the reference for all of the methods of this class.

  5. 5.

    All property, method, and event descriptions were taken directly from Microsoft’s official documentation. The event handler methods used to handle the events of this class were omitted to conserve space. See the reference for all of the methods of this class.

  6. 6.

    All property, method, and event descriptions were taken directly from Microsoft’s official documentation. The event handler methods used to handle the events of this class were omitted to conserve space. See the reference for all of the methods of this class.

  7. 7.

    All property, method, and event descriptions were taken directly from Microsoft’s official documentation. The event handler methods used to handle the events of this class were omitted to conserve space. See the reference for all of the methods of this class.

Author information

Authors and Affiliations

Authors

Rights and permissions

Reprints and permissions

Copyright information

© 2020 Robert E. Beasley

About this chapter

Check for updates. Verify currency and authenticity via CrossMark

Cite this chapter

Beasley, R.E. (2020). Code Behind Database Operations. In: Essential ASP.NET Web Forms Development. Apress, Berkeley, CA. https://doi.org/10.1007/978-1-4842-5784-5_23

Download citation

Publish with us

Policies and ethics