System.Web.UI.WebControls.AccessDataSourceView.ExecuteSelect Method

Retrieves data from the underlying data storage using the SQL string in the SqlDataSourceView.SelectCommand property and any parameters in the SqlDataSourceView.SelectParameters collection.

Syntax

protected override IEnumerable ExecuteSelect (System.Web.UI.DataSourceSelectArguments arguments)

Parameters

arguments
A System.Web.UI.DataSourceSelectArguments that is used to request operations on the data beyond basic data retrieval.

Returns

An IEnumerable of data rows.

Remarks

The System.Web.UI.WebControls.AccessDataSourceView object overrides the SqlDataSourceView.ExecuteSelect(System.Web.UI.DataSourceSelectArguments) method to ensure that the AccessDataSource.DataFile property of its associated System.Web.UI.WebControls.AccessDataSource control is set before retrieving data.

Before the AccessDataSourceView.ExecuteSelect(System.Web.UI.DataSourceSelectArguments) method is performed, the SqlDataSourceView.OnSelecting(SqlDataSourceSelectingEventArgs) method is called to raise the SqlDataSourceView.Selecting event. You can handle the SqlDataSourceView.Selecting event to examine the values of the parameters and to perform any preprocessing before a data retrieval operation.

To perform the data retrieval, the System.Web.UI.WebControls.AccessDataSourceView object builds an System.Data.IDbCommand object using the SqlDataSource.SelectCommand text and any associated SqlDataSource.SelectParameters properties. Then, the System.Web.UI.WebControls.AccessDataSourceView object executes the System.Data.IDbCommand object against the underlying data storage. After the operation completes, the SqlDataSourceView.OnSelected(SqlDataSourceStatusEventArgs) method is called to raise the SqlDataSource.Selected event. You can handle the SqlDataSource.Selected event to examine any return values and error codes and to perform any post-processing.

If the SqlDataSource.DataSourceMode property is set to the SqlDataSourceMode.DataSet value and caching is enabled, the System.Web.UI.WebControls.AccessDataSourceView retrieves data from and saves data to the cache during the data retrieval operation. The cache is created, discarded, or refreshed, based on the caching behavior that is specified by the combination of the SqlDataSource.CacheDuration and SqlDataSource.CacheExpirationPolicy properties.

If the SqlDataSource.DataSourceMode property is set to the SqlDataSourceMode.DataSet value and a SqlDataSourceView.FilterExpression property has been specified, the SqlDataSource.DataSourceMode property is evaluated along with any supplied SqlDataSourceView.FilterParameters properties and the resulting filter is applied to the list of data during the SqlDataSource.Select(System.Web.UI.DataSourceSelectArguments) operation.

Requirements

Namespace: System.Web.UI.WebControls
Assembly: System.Web (in System.Web.dll)
Assembly Versions: 2.0.0.0
Since: .NET 2.0