ISqlSession.ExecuteReader method (SqlCommand, CommandBehavior)

Executes a Transact-SQL query that returns a rowset based on the specified SQL command and behavior.

Namespace:  Microsoft.SharePoint.Utilities
Assembly:  Microsoft.SharePoint (in Microsoft.SharePoint.dll)

Syntax

'Declaration
Function ExecuteReader ( _
    command As SqlCommand, _
    behavior As CommandBehavior _
) As SqlDataReader
'Usage
Dim instance As ISqlSession
Dim command As SqlCommand
Dim behavior As CommandBehavior
Dim returnValue As SqlDataReader

returnValue = instance.ExecuteReader(command, _
    behavior)
SqlDataReader ExecuteReader(
    SqlCommand command,
    CommandBehavior behavior
)

Parameters

Return value

Type: System.Data.SqlClient.SqlDataReader
A SqlDataReader object that represents the rowset.

Remarks

The ExecuteReader method enforces CloseConnection object behavior.

This method throws a Exception exception if the command fails to execute.

See also

Reference

ISqlSession interface

ISqlSession members

ExecuteReader overload

Microsoft.SharePoint.Utilities namespace