DataSource.ExecuteReader Method

System.Data.Generic

DataSourceExecuteReader Method
Sends the SQL Query to the Connection and builds a SqlDataReader.

Namespace: System.Data.Generic
Assembly: System.Data.Generic (in System.Data.Generic.dll) Version: 1.9.5473.30542 (1.9.5473.2392)
Syntax
public IDataReader ExecuteReader(
	string SQL
)
Public Function ExecuteReader ( 
	SQL As String
) As IDataReader
public:
IDataReader^ ExecuteReader(
	String^ SQL
)
member ExecuteReader : 
        SQL : string -> IDataReader 

Parameters

SQL
Type: SystemString
SQL Query to execute.

Return Value

Type: IDataReader
SqlDataReader.
Exceptions
ExceptionCondition
ArgumentNullExceptionIn case the SQL is null.
SqlExceptionIn case the underlying connection cause an exception.
Remarks
The ExecuteReader method keeps the connection open. Dispose of the DbDataReader will close the connection.
See Also