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 参数为 null(Microsoft Visual Basic 中的 Nothing

EndExecuteXmlReader(IAsyncResult) 为单个命令执行多次调用,或者方法与其执行方法不匹配(例如,调用 EndExecuteXmlReader(IAsyncResult) 代码以完成对它的 BeginExecuteNonQuery()调用的执行)。

示例

有关演示如何使用 EndExecuteXmlReader 该方法的示例,请参阅 BeginExecuteXmlReader

注解

调用 BeginExecuteXmlReader 以执行 Transact-SQL 语句时,必须调用 EndExecuteXmlReader才能完成该操作。 如果执行命令的过程尚未完成,此方法将阻止操作完成。 用户可以使用该方法返回BeginExecuteXmlReaderIAsyncResult实例来验证该命令是否已完成其操作。 如果在调用 BeginExecuteXmlReader中指定了回调过程,则必须调用此方法。

适用于

另请参阅