Use Async CTP VB with SqlDataAdapter for a Select statement and a DataSet
I want to know how to use the ASYNC CTP to manage the querying of a SQL Database with a SQL Select statement and use a SQLDataAdapter to fill in a DataSet. I have downloaded the VS2010 SP1 and the ASYNC CTP, I have also rev开发者_如何学运维iewed the videos on the MSDN site and the documentation included.
Okay, I understand your question now.
You can't have SqlDataAdapter fill dataset asynchronously. SqlDataAdapter doesn't provide support for asynchronous event programming such as those in Windows Forms' PictureBox and SoundPlayer.
If you want to do async on SqlDataAdapter, you have to extend SqlDataAdapter to implement Completion and Cancellation event handling, by yourself. You have to define completed event and async event args, by deriving from the AsyncCompletedEventArgs class.
For more information, visit: "Walkthrough: Implementing a Component That Supports the Event-based Asynchronous Pattern" on MSDN Library.
精彩评论