Click here to view and discuss this page in DocCommentXchange. In the future, you will be sent there automatically.

SQL Anywhere 10.0.1 » UltraLite - .NET Programming » UltraLite .NET 1.0 API Reference » ULCommand class

ExecuteReader method Next Page

ExecuteReader method


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

Syntax

Visual Basic

Overloads Public Function ExecuteReader( _
ByVal cmdBehavior As CommandBehavior _
) As ULDataReader

C#

public ULDataReader ExecuteReader(
CommandBehavior cmdBehavior
);

Parameters
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.

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(System.Data.CommandBehavior).

Exceptions
See also