Professional ASP.NET 3.5 in C# and Visual Basic Part 45

Professional in C# and Visual Basic Part 45. Building on the revolutionary release, adds several key new developer features including AJAX, LINQ, and a new CSS designer in Visual Web Developer 2008. The dramatic reduction in code that developers realized from the more than 50 new server controls in now allows developers the time to make their applications more interactive with AJAX, to work with data in their preferred language with LINQ, and to build visually attractive and consistent standards-based sites with CSS. . | Chapter 8 Data Managementwith XML file. It didn t even allow you to serialize the DataTable object independently of the larger and encompassing DataSet object. This limitation required you to always use the DataSet object to perform any operation on a DataTable. The current version of removes this limitation and enables you to work directly with the DataTable for all your needs. In fact we recommend that you don t use the DataSet object unless you need to work with multiple DataTable objects and need a container object to manage them. If you end up working with only a single table of information then it is best to work with an instance of the DataTable object rather than a DataSet that contains only a single DataTable. The current version of provides the capability to load a DataTable in memory by consuming a data source using a DataReader. In the past you were sometimes restricted to creating multiple overloads of the same method just to work with both the DataReader and the DataTable objects. Now you have the flexibility to write the data access code one time and reuse the DataReader either directly or to fill a DataTable as shown in Listing 8-11. Listing 8-11 How to load a DataTable from a DataReader VB @ Page Language VB @ Import Namespace @ Import Namespace @ Import Namespace script runat server Protected Sub Page_Load ByVal sender As Object _ ByVal e As If Not Then Dim MyDataTable As DataTable Dim MyReader As SqlDataReader Dim CityParam As SqlParameter Dim MyConnection As SqlConnection New SqlConnection _ DSN_Northwind .ConnectionString Dim MyCommand As SqlCommand New SqlCommand _ SELECT FROM CUSTOMERS WHERE CITY @CITY MyConnection CityParam New SqlParameter @CITY .

Không thể tạo bản xem trước, hãy bấm tải xuống
TỪ KHÓA LIÊN QUAN
TÀI LIỆU MỚI ĐĂNG
Đã phát hiện trình chặn quảng cáo AdBlock
Trang web này phụ thuộc vào doanh thu từ số lần hiển thị quảng cáo để tồn tại. Vui lòng tắt trình chặn quảng cáo của bạn hoặc tạm dừng tính năng chặn quảng cáo cho trang web này.