Skip to Main Content
ASP.NET 2.0: A Developer's Notebook
book

ASP.NET 2.0: A Developer's Notebook

by Wei-Meng Lee
June 2005
Intermediate to advanced content levelIntermediate to advanced
348 pages
7h 40m
English
O'Reilly Media, Inc.
Content preview from ASP.NET 2.0: A Developer's Notebook

Chapter 4. Data Access

Data access is one of the most common tasks that you’re likely to perform when you write web applications. This is made evident by the number of new data controls that ship with Visual Studio 2005. Most visible in ASP.NET 2.0 is the new GridView control, which is a much improved version of the venerable DataGrid control (the older DataGrid control is still supported in ASP.NET 2.0, though). In addition, ASP.NET 2.0 ships with several new data source controls that make it easier to consume a variety of data sources.

Display Data in a Table

If you’ve done serious ASP.NET programming you’ve probably used the DataGrid control. DataGrid is a very powerful and flexible control for displaying structured data from a data source such as a database. However, when it comes to manipulating the content of a DataGrid control, such as editing the rows or simply sorting the columns of a table, you need to write a moderate amount of code to customize it.

This is where the GridView control comes in handy. Instead of requiring you to write code to perform such common functions as editing or displaying rows in multiple pages, the GridView control now accomplishes the same tasks as the DataGrid control, but with much less coding and work.

The GridView control can be found in the Toolbox under the Data tab (see Figure 4-1).

The GridView control
Figure 4-1. The GridView control

Note

Using the new GridView ...

Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Start your free trial

You might also like

Jumping from ASP to ASP.NET

Jumping from ASP to ASP.NET

Doug Parsons

Publisher Resources

ISBN: 0596008120Supplemental ContentErrata Page