异步读取数据库中数据

在普通sql语句后面加上;async=true.

There are four common ways to use BeginXXX and EndXXX to make asynchronous calls. In all cases, you
invoke BeginXXX to initiate the call. After that, you can do one of the following:

Do some work and then call EndXXX. If the asynchronous operation is not finished, EndXXX will
block until it completes.
❑ Using a WaitHandle obtained from the IAsyncResult.AsyncWaitHandle property, call the
WaitOne() method to block until the operation completes; then call EndXXX.
❑ Poll the IAsynResult.IsCompleted property to determine when the asynchronous operation
has completed; then call EndXXX.
❑ Pass a delegate for a callback function that you supply (of type IAsyncCallback) to BeginXXX.
That callback function will execute when the asynchronous operation completes. Code in the
callback function calls EndXXX to retrieve the result.

posted @ 2009-04-21 20:32  Devid  阅读(1022)  评论(2编辑  收藏  举报