Dotnet-Project Framework documentation.

GenericDataHelper.ExecuteXmlReader Method (IDbConnection, String, IDataParameter[])

Execute a stored procedure via a Command (that returns a resultset) against a Connection using the provided parameters.

public static XmlReader ExecuteXmlReader(
   out IDbConnection aConnection,
   string spName,
   params IDataParameter[] commandParameters
);

Parameters

aConnection
The connection used and that you must close.
spName
The stored procedure name using "FOR XML AUTO"
commandParameters
An array of Parameters used to execute the command

Return Value

An XmlReader containing the resultset generated by the command

Remarks

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

Example

IDbConnection connection = null;
XmlReader r = ExecuteXmlReader(out connection, "GetOrders", new SqlParameter("@prodid", 24));
/* Do work */
r.Close();
connection.Close();

See Also

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