Click here to view and discuss this page in DocCommentXchange. In the future, you will be sent there automatically.
执行具有指定命令行为的 SQL SELECT 语句并返回结果集。
Public Shadows Function ExecuteReader( ByVal cmdBehavior As CommandBehavior ) As ULDataReader
public new ULDataReader ExecuteReader(CommandBehavior cmdBehavior)
cmdBehavior 用于描述查询结果及其对连接影响的 System.Data.CommandBehavior 标志的逐位组合。UltraLite.NET 仅支持 System.Data.CommandBehavior.Default、System.Data.CommandBehavior.CloseConnection 和 System.Data.CommandBehavior.SchemaOnly 标志。
ULDataReader 对象形式的结果集。
ULException 类 发生 SQL 错误。
InvalidOperationException 该命令处于无效状态。ULCommand.Connection 值缺失或关闭、ULCommand.Transaction 值与连接的当前事务状态不匹配,或者 ULCommand.CommandText 值无效。
该语句就是当前的 ULCommand 对象,它具有必需的 ULCommand.CommandText 和任何 ULCommand.Parameters 值。ULDataReader 对象为只读结果集。要获得可编辑的结果集,请使用 ULCommand.ExecuteResultSet(CommandBehavior) 方法、ULCommand.ExecuteTable(CommandBehavior) 方法或 ULDataAdapter 对象。
如果 ULCommand.CommandType 为 System.Data.CommandType.TableDirect,则 ExecuteReader 方法会执行 ULCommand.ExecuteTable(CommandBehavior) 调用并返回一个转换为 ULDataReader 对象的 ULTable 对象。
出于性能原因,SELECT 语句在缺省情况下标记为只读。如果要将该查询用于执行更新,则此语句必须以 "FOR UPDATE" 作为结尾。
这是 System.Data.IDbCommand.ExecuteReader(System.Data.CommandBehavior) 方法和 System.Data.Common.DbCommand.ExecuteReader(System.Data.CommandBehavior) 方法的强类型版本。