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
command
Type: System.Data.SqlClient.SqlCommandA SqlCommand object that represents the Transact-SQL query to execute.
behavior
Type: System.Data.CommandBehaviorA bitwise combination of values from the CommandBehavior
enumeration.
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.