System.Data.SqlClient.SqlCommand.EndExecuteXmlReader Method

Finishes asynchronous execution of a Transact-SQL statement, returning the requested data as XML.

Syntax

public System.Xml.XmlReader EndExecuteXmlReader (IAsyncResult asyncResult)

Parameters

asyncResult
The IAsyncResult returned by the call to SqlCommand.BeginExecuteXmlReader.

Returns

An System.Xml.XmlReader object that can be used to fetch the resulting XML data.

Remarks

When you call erload:System.Data.SqlClient.SqlCommand.BeginExecuteXmlReader to execute a Transact-SQL statement, you must call SqlCommand.EndExecuteXmlReader(IAsyncResult) in order to complete the operation. If the process of executing the command has not yet finished, this method blocks until the operation is complete. Users can verify that the command has completed its operation by using the IAsyncResult instance returned by the SqlCommand.BeginExecuteXmlReader method. If a callback procedure was specified in the call to SqlCommand.BeginExecuteXmlReader, this method must be called.

Requirements

Namespace: System.Data.SqlClient
Assembly: System.Data (in System.Data.dll)
Assembly Versions: 2.0.0.0