System.Data.OleDb.OleDbCommand.ExecuteReader Method

Sends the OleDbCommand.CommandText to the OleDbCommand.Connection and builds an System.Data.OleDb.OleDbDataReader.

Syntax

public OleDbDataReader ExecuteReader ()

Returns

An System.Data.OleDb.OleDbDataReader object.

Remarks

When the OleDbCommand.CommandType property is set to StoredProcedure, the OleDbCommand.CommandText property should be set to the name of the stored procedure. The command executes this stored procedure when you call OleDbCommand.ExecuteReader.

Before you close the System.Data.OleDb.OleDbConnection, first close the System.Data.OleDb.OleDbDataReader object. You must also close the System.Data.OleDb.OleDbDataReader object if you plan to reuse an System.Data.OleDb.OleDbCommand object.

Requirements

Namespace: System.Data.OleDb
Assembly: System.Data (in System.Data.dll)
Assembly Versions: 1.0.5000.0, 2.0.0.0