Chapter 12. Displaying and Updating Data

Now that you have seen how to interact with databases using SQL it's time to put that knowledge into practice and start building some useful pages that allow you to manage the data in your web site.

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.

In particular, this chapter gives you a good look at the following topics:

  • Controls that display and maintain data in your web site

  • How to display data using the GridView control

  • How to access the database to retrieve and update data using a SqlDataSource control

  • How to insert, edit, and delete data using the data controls like the GridView and the DetailsView

  • How to create a rich interface that allows 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 updateable

The first things you need to look at are the available data controls, discussed in the next section.

Get Beginning ASP.NET 3.5: In C# and VB now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.