DbCommand.ExecuteReader 方法
定义
针对 CommandText 执行 Connection,并返回 DbDataReader。Executes the CommandText against the Connection and returns a DbDataReader.
重载
ExecuteReader() |
针对 CommandText 执行 Connection,并返回 DbDataReader。Executes the CommandText against the Connection, and returns an DbDataReader. |
ExecuteReader(CommandBehavior) |
针对 CommandText 执行 Connection,并使用 DbDataReader 值之一返回 CommandBehavior。Executes the CommandText against the Connection, and returns an DbDataReader using one of the CommandBehavior values. |
ExecuteReader()
针对 CommandText 执行 Connection,并返回 DbDataReader。Executes the CommandText against the Connection, and returns an DbDataReader.
public:
System::Data::Common::DbDataReader ^ ExecuteReader();
public System.Data.Common.DbDataReader ExecuteReader ();
member this.ExecuteReader : unit -> System.Data.Common.DbDataReader
Public Function ExecuteReader () As DbDataReader
返回
DbDataReader 对象。A DbDataReader object.
另请参阅
适用于
ExecuteReader(CommandBehavior)
针对 CommandText 执行 Connection,并使用 DbDataReader 值之一返回 CommandBehavior。Executes the CommandText against the Connection, and returns an DbDataReader using one of the CommandBehavior values.
public:
System::Data::Common::DbDataReader ^ ExecuteReader(System::Data::CommandBehavior behavior);
public System.Data.Common.DbDataReader ExecuteReader (System.Data.CommandBehavior behavior);
member this.ExecuteReader : System.Data.CommandBehavior -> System.Data.Common.DbDataReader
Public Function ExecuteReader (behavior As CommandBehavior) As DbDataReader
参数
- behavior
- CommandBehavior
用于指定命令行为的枚举值之一。One of the enumeration values that specifies the command behavior.
返回
一个 DbDataReader 对象。An DbDataReader object.