Version

GetReader(IDbCommand) Method

Gets an IDataReader for a database selection with the default behavior.
Syntax
'Declaration
 
Protected Overloads Function GetReader( _
   ByVal currentCommand As IDbCommand _
) As IDataReader
protected IDataReader GetReader( 
   IDbCommand currentCommand
)

Parameters

currentCommand
An IDbCommand specifying either a text command based on a SELECT statement, or a stored procedure returning multiple records.

Return Value

An IDataReader open for forward-only, firehose reading access to a command's result set.
Remarks

Inheritors may retrieve an IDataReader for use with an IDbCommand they've initialized in their own implementation of a fetch operation method through this method. When this IDataReader exhausts itself, the command behavior applied is based on the current setting of the CommandBehaviorDefault property.

If the Connection was not open before calling this method, then this method will open it (certain behaviors such as CloseConnection will effectively close the connection when you are through with this data reader) because calling Read on a data reader while the connection is closed is not allowed.

Inheritors must not allow this method to be called prior to the initialization and establishment of a good Connection. This shouldn't be a problem as long as GetReader is only called during data binding operations.

Requirements

Target Platforms: Windows 10, Windows 8.1, Windows 8, Windows 7, Windows Vista SP1 or later, Windows XP SP3, Windows Server 2008 (Server Core not supported), Windows Server 2008 R2 (Server Core supported with SP1 or later), Windows Server 2003 SP2

See Also