SqlCeCommand.ExecuteReader Method (CommandBehavior)

Note: This namespace, class, or member is supported only in version 1.1 of the .NET Framework.

Sends the CommandText to the Connection and builds a SqlCeDataReader by using one of the CommandBehavior values.

  [Visual Basic]
  Overloads Public Function ExecuteReader( _
   ByVal 
  behavior
   As CommandBehavior _
) As SqlCeDataReader
[C#]
public SqlCeDataReader ExecuteReader(CommandBehavior behavior
);
[C++]
public: SqlCeDataReader* ExecuteReader(CommandBehavior behavior
);
[JScript]
public function ExecuteReader(
   behavior : CommandBehavior) : SqlCeDataReader;

Parameters

Return Value

A SqlCeDataReader object.

Exceptions

Exception Type Condition
InvalidOperationException Cannot execute a command within a transaction context that differs from the context in which the connection was originally enlisted.

Remarks

The SqlCeDataReader supports a special mode that enables large binary values to be read efficiently. For more information, see the SequentialAccess setting for CommandBehavior.

While the SqlCeDataReader is in use, the associated SqlCeConnection is busy serving the SqlCeDataReader. In this state, until you call the Close method of the SqlCeDataReader, you can perform only the Close operation on the SqlCeConnection.

Requirements

Platforms: .NET Compact Framework

.NET Framework Security:

See Also

SqlCeCommand Class | SqlCeCommand Members | System.Data.SqlServerCe Namespace | SqlCeCommand.ExecuteReader Overload List

Syntax based on .NET Framework version 1.1.
Documentation version 1.1.1.

Send comments on this topic.

© Microsoft Corporation. All rights reserved.