System.Data.SqlClient Namespace SqlCommand Class
Sends the CommandText to the Connection, and builds an SqlDataReader using one of the CommandBehavior values.
[ VB ] Overloads Public Function ExecuteReader ( _ ByVal behavior As CommandBehavior _ ) As SqlDataReader [ C# ] public SqlDataReader ExecuteReader ( CommandBehavior behavior ); [ C++ ] public: SqlDataReader* ExecuteReader ( CommandBehavior behavior ); [ JScript ] public function ExecuteReader ( behavior : CommandBehavior ) : SqlDataReader;
An SqlDataReader object.
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 SqlDataReader supports a special mode that enables large binary values to be read efficiently. For more information, see the SequentialAccess setting for CommandBehavior.
While the SqlDataReader is in use, the associated SqlConnection is busy serving the SqlDataReader. While in this state, no other operatons can be performed on the SqlConnection other than closing it. This is the case until the Close method of the SqlDataReader is called.
The following examples demonstrate using this version of the ExecuteReader method.
SqlCommand Members SqlCommand.ExecuteReader Overload List
© 2000-2010 Rey Nuñez All rights reserved.If you have any question, comment or suggestion about this site, please send us a note
You can help support asp.net.ph