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)

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: IDataReaderSqlDataReader.

Exception | Condition |
---|---|
ArgumentNullException | In case the SQL is null. |
SqlException | In case the underlying connection cause an exception. |

The ExecuteReader method keeps the connection open. Dispose of the DbDataReader will close the connection.
