SqlCommand.EndExecuteXmlReader(IAsyncResult) 方法

定義

完成非同步執行 Transact-SQL 語句,將請求的資料以 XML 格式回傳。

public:
 System::Xml::XmlReader ^ EndExecuteXmlReader(IAsyncResult ^ asyncResult);
public System.Xml.XmlReader EndExecuteXmlReader(IAsyncResult asyncResult);
member this.EndExecuteXmlReader : IAsyncResult -> System.Xml.XmlReader
Public Function EndExecuteXmlReader (asyncResult As IAsyncResult) As XmlReader

參數

asyncResult
IAsyncResult

他們IAsyncResult透過呼叫返回。BeginExecuteXmlReader()

傳回

一個 XmlReader 可以用來擷取所得 XML 資料的物件。

例外狀況

asyncResult 參數為空(Nothing 在 Microsoft Visual Basic)

EndExecuteXmlReader(IAsyncResult) 在單一指令執行中被呼叫超過一次,或是該方法與其執行方法不匹配(例如,程式碼呼叫 EndExecuteXmlReader(IAsyncResult) 完成對 BeginExecuteNonQuery()的呼叫執行。

範例

關於示範該 EndExecuteXmlReader 方法的範例,請參見 BeginExecuteXmlReader

備註

當你呼叫 BeginExecuteXmlReader 執行 Transact-SQL 語句時,必須呼叫 EndExecuteXmlReader 才能完成該操作。 如果執行指令的過程尚未完成,此方法會阻塞直到操作完成。 使用者可以透過方法回傳BeginExecuteXmlReaderIAsyncResult實例來驗證指令是否已完成操作。 若呼叫時指定 BeginExecuteXmlReader了回調程序,則必須呼叫此方法。

適用於

另請參閱