Share via


ISqlSession.ExecuteReader method (SqlCommand)

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

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

Syntax

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

returnValue = instance.ExecuteReader(command)
SqlDataReader ExecuteReader(
    SqlCommand command
)

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