DataSourceSelectArguments Class (System.Web.UI)

Switch View :
ScriptFree
.NET Framework Class Library
DataSourceSelectArguments Class

Provides a mechanism that data-bound controls use to request data-related operations from data source controls when data is retrieved. This class cannot be inherited.

Inheritance Hierarchy

System.Object
  System.Web.UI.DataSourceSelectArguments

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

Visual Basic
Public NotInheritable Class DataSourceSelectArguments
C#
public sealed class DataSourceSelectArguments
Visual C++
public ref class DataSourceSelectArguments sealed
F#
[<Sealed>]
type DataSourceSelectArguments =  class end

The DataSourceSelectArguments type exposes the following members.

Constructors

  Name Description
Public method DataSourceSelectArguments() Initializes a new default instance of the DataSourceSelectArguments class.
Public method DataSourceSelectArguments(String) Initializes a new instance of the DataSourceSelectArguments class with the specified sort expression.
Public method DataSourceSelectArguments(Int32, Int32) Initializes a new instance of the DataSourceSelectArguments class with the specified starting position and number of rows to return for paging scenarios.
Public method DataSourceSelectArguments(String, Int32, Int32) Initializes a new instance of the DataSourceSelectArguments class with the specified sort expression, starting position, and number of rows to return for paging scenarios.
Top
Properties

  Name Description
Public property Static member Empty Gets a DataSourceSelectArguments object with the sort expression set to Empty.
Public property MaximumRows Gets or sets a value that represents the maximum number of data rows that a data source control returns for a data retrieval operation.
Public property RetrieveTotalRowCount Gets or sets a value indicating whether a data source control should retrieve a count of all the data rows during a data retrieval operation.
Public property SortExpression Gets or sets an expression that the data source view uses to sort the data retrieved by the DataSourceView.Select(DataSourceSelectArguments, DataSourceViewSelectCallback) method.
Public property StartRowIndex Gets or sets a value that represents the starting position the data source control should use when retrieving data rows during a data retrieval operation.
Public property TotalRowCount Gets or sets the number of rows retrieved during a data retrieval operation.
Top
Methods

  Name Description
Public method AddSupportedCapabilities Adds one capability to the DataSourceSelectArguments instance, which is used to compare supported capabilities and requested capabilities.
Public method Equals Determines whether the specified DataSourceSelectArguments instance is equal to the current instance. (Overrides Object.Equals(Object).)
Protected method Finalize Allows an object to try to free resources and perform other cleanup operations before it is reclaimed by garbage collection. (Inherited from Object.)
Public method GetHashCode Serves as a hash function for a particular type. (Overrides Object.GetHashCode().)
Public method GetType Gets the Type of the current instance. (Inherited from Object.)
Protected method MemberwiseClone Creates a shallow copy of the current Object. (Inherited from Object.)
Public method RaiseUnsupportedCapabilitiesError Compares the capabilities requested for an ExecuteSelect(DataSourceSelectArguments) operation against those that the specified data source view supports.
Public method ToString Returns a string that represents the current object. (Inherited from Object.)
Top
Remarks

Data-bound controls use the DataSourceSelectArguments class to request that a data source control performs additional data-related operations on a result set, such as sorting the data or returning a specific subset of data. These data-related operations are enumerated by the DataSourceCapabilities enumeration. The following table indicates how the DataSourceSelectArguments class supports these data-related operations.

Capability

Related DataSourceSelectArguments properties

DataSourceCapabilities.Sort

SortExpression

DataSourceCapabilities.Page

StartRowIndex , MaximumRows

DataSourceCapabilities.RetrieveTotalRowCount

RetrieveTotalRowCount , TotalRowCount

Data-bound controls explicitly call the PerformSelect method to bind data, which calls the Select(DataSourceSelectArguments, DataSourceViewSelectCallback) method of the data source control they are associated with. In this way, the data-bound control retrieves data from the data source control on demand. Because the Select(DataSourceSelectArguments, DataSourceViewSelectCallback) method accepts a DataSourceSelectArguments parameter, the data-bound control is responsible for creating and managing a DataSourceSelectArguments object and passing it to the Select(DataSourceSelectArguments, DataSourceViewSelectCallback) method when it retrieves data from the data source control.

In some cases, data-bound controls might not need any additional data-related capabilities. In this case, data-bound controls pass an Empty arguments object to the Select(DataSourceSelectArguments, DataSourceViewSelectCallback) method.

For sorted result sets, data-bound controls check a data source view's CanSort property at run time, and add a DataSourceCapabilities.Sort capability using the AddSupportedCapabilities(DataSourceCapabilities) method. As a separate operation, the data-bound control can request a sorted result set from a data source control by setting the SortExpression property on the DataSourceSelectArguments object passed to the Select(DataSourceSelectArguments, DataSourceViewSelectCallback) method.

For paging scenarios, data-bound controls check a data source view's CanPage property at run time, and add a DataSourceCapabilities.Page capability using the AddSupportedCapabilities(DataSourceCapabilities) method. As a separate operation, the data-bound control can request a subset of data from a data source control for paging by setting the StartRowIndex and MaximumRows properties on the DataSourceSelectArguments object passed to the Select(DataSourceSelectArguments, DataSourceViewSelectCallback) method.

To retrieve a total row count for paging scenarios, data-bound controls check a data source view's CanRetrieveTotalRowCount property at run time, and add a DataSourceCapabilities.RetrieveTotalRowCount capability using the AddSupportedCapabilities(DataSourceCapabilities) method. As a separate operation, the data-bound control can request a total row count from a data source control for paging by setting the RetrieveTotalRowCount property on the DataSourceSelectArguments object passed to the Select(DataSourceSelectArguments, DataSourceViewSelectCallback) method. When the Select(DataSourceSelectArguments, DataSourceViewSelectCallback) method returns, the total row count is contained by the TotalRowCount property.

Important note Important

If any of the DataSourceSelectArguments properties are set, but the currently bound data source control does not support the requested capability, an InvalidOperationException exception is thrown when the DataSourceSelectArguments.RaiseUnsupportedCapabilitiesError(DataSourceView) method is called.

Version Information

.NET Framework

Supported in: 4, 3.5, 3.0, 2.0
Platforms

Windows 7, Windows Vista SP1 or later, Windows XP SP3, Windows XP SP2 x64 Edition, Windows Server 2008 (Server Core not supported), Windows Server 2008 R2 (Server Core supported with SP1 or later), Windows Server 2003 SP2

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

Any public static (Shared in Visual Basic) members of this type are thread safe. Any instance members are not guaranteed to be thread safe.
See Also

Reference