ObjectDataSourceSelectingEventArgs.ExecutingSelectCount 属性

定义

获取一个值,该值 ObjectDataSource 指示是否在数据检索操作期间检索行计数。

public:
 property bool ExecutingSelectCount { bool get(); };
public bool ExecutingSelectCount { get; }
member this.ExecutingSelectCount : bool
Public ReadOnly Property ExecutingSelectCount As Boolean

属性值

true如果启用了数据源分页并且 ObjectDataSource 正在检索行计数,则为 ;否则为 false

注解

ObjectDataSource当对象执行数据检索并启用数据源分页时,将调用两次数据检索方法:

  • 检索数据集一次。

  • 检索总行计数一次。

这会引发 Selecting 事件两次。 对于处理 Selecting 事件的代码,确定事件的性质(检索数据或检索行计数),以便处理程序执行的任何其他工作对于执行的每个数据检索操作都不需要重复,这一点可能很重要。

适用于

另请参阅