Executes a SQL SELECT statement and returns the result set.
Visual Basic
Overloads Public Function ExecuteReader() As ULDataReader
C#
public ULDataReader ExecuteReader();
The result set as a ULDataReader object.
The statement is the current ULCommand object, with the ULCommand.CommandText and any ULCommand.Parameters as required. The ULDataReader object is a read-only result set. For editable result sets, use ULCommand.ExecuteResultSet(), ULCommand.ExecuteTable(), or a ULDataAdapter.
If the ULCommand.CommandType is System.Data.CommandType.TableDirect, ExecuteReader performs an ULCommand.ExecuteTable() and returns a ULTable downcast as a ULDataReader.
It is recommended that SELECT statements used with this method to create read-only result sets end with FOR READ ONLY. For some statements that use temporary tables, there may be a significant performance improvement.
This is the strongly-typed version of System.Data.IDbCommand.ExecuteReader().
ULException class - A SQL error occurred.
InvalidOperationException - The command is in an invalid state. Either the ULCommand.Connection is missing or closed, the ULCommand.Transaction value does not match the current transaction state of the connection, or the ULCommand.CommandText is invalid.