ASP.NET 2.0 Unleashed
In the previous chapter, you learned how to use the ObjectDataSource control to bind data controlssuch as the GridView or DetailsView controlsto a data access component. In this chapter, we shift focus from the ObjectDataSource control to the topic of building data access components. This chapter provides you with an overview of ADO.NET. ADO.NET is the main set of classes included in the .NET Framework for working with database data. For example, under the covers, the SqlDataSource control uses ADO.NET classes to retrieve data from a SQL Server database. The classes in the ADO.NET framework support two models of data access: a connected and disconnected model. In the first part of this chapter, you learn how to take advantage of the connected model of data access. You learn how to use the ADO.NET Connection, Command, and DataReader classes to retrieve and modify database data. In the next part of this chapter, you learn how to take advantage of the disconnected model of data access represented by the ADO.NET DataAdapter, DataTable, DataView, and DataSet classes. You can use these classes to build an in-memory representation of database data. Finally, at the end of this chapter, we explore two advanced topics. You learn how to take advantage of two important new features included in ADO.NET 2.0. First, you learn how to improve the performance of your database access code by executing asynchronous database commands. You learn how to build asynchronous ASP.NET pages that execute asynchronous ADO.NET commands. You also learn how to build Microsoft SQL Server database objects, such as stored procedures and user-defined types, by using the .NET Framework. For example, you learn how to write a Microsoft SQL Server stored procedure, using the Visual Basic .NET programming language. |
Категории