您的位置:首页 > 数据库

异步读取数据库中数据

2009-04-21 20:32 204 查看
在普通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.
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: