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

Professional in C# and Visual Basic Part 49. 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 Method Description WaitAll waitHandles This overloaded method receives the time-out value in the form of milliseconds exitContext milliseconds and a Boolean value specifying whether the method requires asynchronous context. It should be set to False for asynchronous processing. WaitAll waitHandles This overloaded method receives the time-out value in the form of timeSpan exitContext TimeSpan object. The second parameter receives a Boolean value specifying whether the method requires asynchronous context. It should be set to False for asynchronous processing. Close This method releases all wait handles and reclaims their resources. Now that you understand asynchronous methods added to the SqlCommand and how to properly interact with them you can write some code to see the asynchronous processing in action. Approaches ofAsynchronous Processingin You can process asynchronous commands in three distinct ways. One approach is to start the asynchronous process and start polling the lAsyncResult object to see when the process has finished. The second approach is to provide a callback method while starting the asynchronous process. This approach enables you to perform other tasks in parallel. When the asynchronous process finishes it fires the callback method that cleans up after the process and notifies other parts of the program that the asynchronous process has finished. The third and most elegant method is to associate a wait handle with the asynchronous process. Using this approach you can start all the asynchronous processing you want and then wait for all or any of them to finish so that you can process them accordingly. The Poll Approach The code shown in Listing 8-31 creates an inline SQL statement to retrieve the top five records from the Orders table from the Northwind database. It starts the asynchronous process by calling the Begin-ExecuteReader. After the asynchronous process has started it uses a while loop to .

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.