© Robert E. Beasley 2020
R. E. BeasleyEssential ASP.NET Web Forms Developmenthttps://doi.org/10.1007/978-1-4842-5784-5_23

23. Code Behind Database Operations

Robert E. Beasley1 
Franklin, IN, USA

23.1 Introduction

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 ...

Get Essential ASP.NET Web Forms Development: Full Stack Programming with C#, SQL, Ajax, and JavaScript now with O’Reilly online learning.

O’Reilly members experience live online training, plus books, videos, and digital content from 200+ publishers.