Displaying and Updating Data
What You Will Learn in This Chapter:
- How to display, insert, edit, and delete data using controls such as GridView, DetailsView, and SqlDataSource
- How to create a rich interface that enables a user to insert and edit data while maintaining data integrity with the ASP.NET validation controls
- The best way to store your connection strings in your application so they are easily updatable
Wrox.com Code Downloads for this Chapter
You can find the wrox.com code downloads for this chapter on the Download Code tab at www.wrox.com/remtitle.cgi?isbn=1118311809. The code is in the Chapter 13 download.
In this chapter you learn how to display, insert, update, and delete data using the popular data controls that ship with ASP.NET. Besides working with the visual controls that are used to display and edit data in a web page, you also learn how to work with the SqlDataSource control that acts as the bridge between the database and your ASPX pages.
The first things you need to look at are the available data controls, discussed in the next section.
To enable you to work efficiently with the data in your system, ASP.NET offers two sets of data-aware controls: the data-bound controls and the data source controls.
The first group contains controls that you use to display and edit data, such as the GridView, Repeater, and ListView controls in the user interface. The data source controls are used to retrieve data from a data source, like a database ...