Dotnet-Project Framework documentation.

GenericDataHelper.ExecuteXmlReader Method (IDbConnection, CommandType, String)

Execute a Command (that returns a resultset and takes no parameters) against a Connection.

public static XmlReader ExecuteXmlReader(
   out IDbConnection aConnection,
   CommandType commandType,
   string commandText
);

Parameters

aConnection
The connection used and that you must close.
commandType
The CommandType (stored procedure, text, etc.)
commandText
The stored procedure name or T-SQL command using "FOR XML AUTO"

Return Value

An XmlReader containing the resultset generated by the command

Example

This method does not close the connection created. You must close the connection when you have finished to work with the xmlReader.

IDbConnection connection = null;
XmlReader r = ExecuteXmlReader(out connection, CommandType.StoredProcedure, "GetOrders");
/* Do work */
r.Close();
connection.Close();

See Also

GenericDataHelper Class | DotnetProject.Data Namespace | GenericDataHelper.ExecuteXmlReader Overload List