Was this page helpful?
Your feedback about this content is important. Let us know what you think.
Additional feedback?
1500 characters remaining
Export (0) Print
Expand All

SqlCommand::EndExecuteXmlReader Method

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

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

public:
XmlReader^ EndExecuteXmlReader(
	IAsyncResult^ asyncResult
)

Parameters

asyncResult
Type: System::IAsyncResult

The IAsyncResult returned by the call to BeginExecuteXmlReader.

Return Value

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

ExceptionCondition
ArgumentException

asyncResult parameter is null (Nothing in Microsoft Visual Basic)

InvalidOperationException

EndExecuteXmlReader was called more than once for a single command execution, or the method was mismatched against its execution method (for example, the code called EndExecuteXmlReader to complete execution of a call to BeginExecuteNonQuery.

When you call BeginExecuteXmlReader to execute a Transact-SQL statement, you must call EndExecuteXmlReader 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 BeginExecuteXmlReader method. If a callback procedure was specified in the call to BeginExecuteXmlReader, this method must be called.

For examples demonstrating the use of the EndExecuteXmlReader method, see BeginExecuteXmlReader.

.NET Framework

Supported in: 4.6, 4.5, 4, 3.5, 3.0, 2.0

.NET Framework Client Profile

Supported in: 4, 3.5 SP1
Show:
© 2015 Microsoft