MySQL Connector/Net |
MySqlCommand..::.ExecuteReader Method (CommandBehavior) |
MySqlCommand Class See Also Send Feedback |
Namespace:
MySql.Data.MySqlClient
Assembly:
MySql.Data (in MySql.Data.dll) Version: 6.2.2.0
Syntax
C# |
---|
public MySqlDataReader ExecuteReader( CommandBehavior behavior ) |
Visual Basic (Declaration) |
---|
Public Function ExecuteReader ( _ behavior As CommandBehavior _ ) As MySqlDataReader |
Visual C++ |
---|
public: MySqlDataReader^ ExecuteReader( CommandBehavior behavior ) |
Parameters
- behavior
- Type: System.Data..::.CommandBehavior
One of the CommandBehavior values.
Return Value
A MySqlDataReader object.Remarks
When the CommandType property is set to StoredProcedure, the CommandText property should be set to the name of the stored procedure. The command executes this stored procedure when you call ExecuteReader.
The MySqlDataReader supports a special mode that enables large binary values to be read efficiently. For more information, see the SequentialAccess setting for CommandBehavior.
While the MySqlDataReader is in use, the associated MySqlConnection is busy serving the MySqlDataReader. While in this state, no other operations can be performed on the MySqlConnection other than closing it. This is the case until the Close()()() method of the MySqlDataReader is called. If the MySqlDataReader is created with CommandBehavior set to CloseConnection, closing the MySqlDataReader closes the connection automatically.