Building Data-Bound Pages with Visual Studio .NET "Whidbey"
In this and the previous chapter, we've concentrated on the new controls that are part of ASP.NET 2.0 and make it easy to build data-bound pages that can display and update data. We showed you how easy it is to declare the controls you need and how to add attributes to change the appearance or behavior of the controls. But the main focus has been to help you understand what the controls do and how they are used as part of the overall page design process.Chapter 2, and you saw how comprehensive it is. It is ideal for building data-bound pagesyou can open a connection to a database in the Data Explorer window and then simply drag a table onto the design surface. This automatically creates the appropriate SqlDataSource and GridView controls and sets the relevant properties (see Figure 4.10).
Figure 4.10. Creating a data-bound page with Visual Studio .NET "Whidbey"

The resulting page displays all the rows from that table, as shown in Figure 4.11 on the next page. You can then use the Common Tasks menus or the Properties window to configure the GridView and SqlDataSource controls, apply formatting, add sorting and paging, and so on.
Figure 4.11. Viewing the results

Note that, by default, Visual Studio .NET "Whidbey" changes the ProviderName property of the SqlDataSource control from the default of System.Data.SqlClient to System.Data.OleDb in order to provide maximum compatibility with all types of relational databases. |