ExecuteReader(CommandBehavior) method

Executes a SQL SELECT statement with the specified command behavior and returns the result set.

Syntax
Visual Basic
Public Function ExecuteReader( _
   ByVal cmdBehavior As CommandBehavior _
) As ULDataReader
C#
public ULDataReader ExecuteReader(
   CommandBehavior cmdBehavior
);
Parameters
  • cmdBehavior   A bitwise combination of System.Data.CommandBehavior flags describing the results of the query and its effect on the connection. UltraLite.NET respects only the System.Data.CommandBehavior.Default, System.Data.CommandBehavior.CloseConnection, and System.Data.CommandBehavior.SchemaOnly flags.

Return value

The result set as a ULDataReader object.

Remarks

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(CommandBehavior), ULCommand.ExecuteTable(CommandBehavior), or a ULDataAdapter.

If the ULCommand.CommandType is System.Data.CommandType.TableDirect, ExecuteReader performs an ULCommand.ExecuteTable(CommandBehavior) and returns a ULTable downcast as a ULDataReader.

SELECT statements are marked as read-only by default for performance reasons. If the query is going to be used to make updates, the statement must end with " FOR UPDATE".

This is the strongly-typed version of System.Data.IDbCommand.ExecuteReader(System.Data.CommandBehavior) and System.Data.Common.DbCommand.ExecuteReader(System.Data.CommandBehavior).

See also