共用方式為


DataServiceQuery.BeginExecute 方法

以非同步方式傳送要求以執行資料服務查詢。

命名空間:  System.Data.Services.Client
組件:  Microsoft.Data.Services.Client (在 Microsoft.Data.Services.Client.dll 中)

語法

'宣告
Public Function BeginExecute ( _
    callback As AsyncCallback, _
    state As Object _
) As IAsyncResult
'用途
Dim instance As DataServiceQuery
Dim callback As AsyncCallback
Dim state As Object
Dim returnValue As IAsyncResult

returnValue = instance.BeginExecute(callback, _
    state)
public IAsyncResult BeginExecute(
    AsyncCallback callback,
    Object state
)
public:
IAsyncResult^ BeginExecute(
    AsyncCallback^ callback, 
    Object^ state
)
member BeginExecute : 
        callback:AsyncCallback * 
        state:Object -> IAsyncResult 
public function BeginExecute(
    callback : AsyncCallback, 
    state : Object
) : IAsyncResult

參數

  • state
    型別:System.Object
    傳遞至回呼的使用者定義狀態物件。

傳回值

型別:System.IAsyncResult
用於追蹤非同步作業之狀態的 IAsyncResult 物件。

備註

傳回的 IAsyncResult 物件用來確定非同步作業已完成的時間。 如需詳細資訊,請參閱非同步作業 (WCF Data Services)

BeginExecute 方法與 Execute 方法使用相同的語意,但 BeginExecute 會以非同步方式傳送要求,讓此呼叫不會在等待來自服務的結果時封鎖處理。 根據標準的開始-結束非同步模式,在擷取查詢結果時會叫用所提供的回呼。

請參閱

參考

DataServiceQuery 類別

System.Data.Services.Client 命名空間