Export (0) Print
Expand All

AccessDataSourceView.ExecuteSelect Method

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

Namespace:  System.Web.UI.WebControls
Assembly:  System.Web (in System.Web.dll)

protected internal override IEnumerable ExecuteSelect(
	DataSourceSelectArguments arguments
)

Parameters

arguments
Type: System.Web.UI.DataSourceSelectArguments

A DataSourceSelectArguments that is used to request operations on the data beyond basic data retrieval.

Return Value

Type: System.Collections.IEnumerable
An IEnumerable of data rows.

ExceptionCondition
InvalidOperationException

The DataFile property is null or an empty string ("").

NotSupportedException

The arguments passed to the ExecuteSelect method specify that the data source should perform some additional work while retrieving data to enable paging or sorting through the retrieved data, but the data source control does not support the requested capability.

The AccessDataSourceView object overrides the ExecuteSelect method to ensure that the DataFile property of its associated AccessDataSource control is set before retrieving data.

Before the ExecuteSelect method is performed, the OnSelecting method is called to raise the Selecting event. You can handle the 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 AccessDataSourceView object builds an IDbCommand object using the SelectCommand text and any associated SelectParameters properties. Then, the AccessDataSourceView object executes the IDbCommand object against the underlying data storage. After the operation completes, the OnSelected method is called to raise the Selected event. You can handle the Selected event to examine any return values and error codes and to perform any post-processing.

If the DataSourceMode property is set to the DataSet value and caching is enabled, the 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 CacheDuration and CacheExpirationPolicy properties.

If the DataSourceMode property is set to the DataSet value and a FilterExpression property has been specified, the DataSourceMode property is evaluated along with any supplied FilterParameters properties and the resulting filter is applied to the list of data during the Select operation.

.NET Framework

Supported in: 4.5.2, 4.5.1, 4.5, 4, 3.5, 3.0, 2.0

Windows 8.1, Windows Server 2012 R2, Windows 8, Windows Server 2012, Windows 7, Windows Vista SP2, Windows Server 2008 (Server Core Role not supported), Windows Server 2008 R2 (Server Core Role supported with SP1 or later; Itanium not supported)

The .NET Framework does not support all versions of every platform. For a list of the supported versions, see .NET Framework System Requirements.

Show:
© 2014 Microsoft