.NET Framework Class Library SqlDataSourceSelectingEventArgs Class

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

Syntax
Public Class SqlDataSourceSelectingEventArgs _
Inherits SqlDataSourceCommandEventArgs
public class SqlDataSourceSelectingEventArgs : SqlDataSourceCommandEventArgs
public ref class SqlDataSourceSelectingEventArgs : public SqlDataSourceCommandEventArgs
type SqlDataSourceSelectingEventArgs =
class
inherit SqlDataSourceCommandEventArgs
end
The SqlDataSourceSelectingEventArgs type exposes the following members.

Constructors

Properties

Methods

Remarks
By adding an event handler delegate to handle the Selecting event, you can perform any additional preprocessing required or cancel the database query entirely. Because the SqlDataSourceSelectingEventArgs class is derived from the SqlDataSourceCommandEventArgs class, you can cancel a pending SqlDataSource database query by setting the Cancel property to true. You can examine and manipulate the CommandText, Parameters collection, and other database query properties prior to running the query by accessing the DbCommand object exposed by the Command property. You can also examine the DataSourceSelectArguments object that is passed to the Select method by accessing the Arguments property. The SqlDataSourceSelectingEventArgs class is used in the OnSelecting method to provide access to a SqlDataSource database query before it is run. The SqlDataSource control exposes many events that you can handle to work with the underlying data objects during the course of a data operation. The following table lists the events and associated EventArgs classes and event handler delegates. Event | EventArgs | EventHandler |
|---|
Selecting. Occurs before the data is retrieved. |
SqlDataSourceSelectingEventArgs
|
SqlDataSourceSelectingEventHandler
|
Inserting, Updating, and Deleting. Occur before an insert, update, or delete operation is performed. |
SqlDataSourceCommandEventArgs
|
SqlDataSourceCommandEventHandler
|
Selected, Inserted, Updated, and Deleted. Occur after the data retrieval, insert, update, or delete operation completes. |
SqlDataSourceStatusEventArgs
|
SqlDataSourceStatusEventHandler
|

Version Information
.NET FrameworkSupported 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 Role not supported), Windows Server 2008 R2 (Server Core Role not supported), 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
|
Bibliothèque de classes .NET Framework SqlDataSourceSelectingEventArgs, classe

Hiérarchie d'héritage
Espace de noms :
System.Web.UI.WebControls
Assembly :
System.Web (dans System.Web.dll)

Syntaxe
Public Class SqlDataSourceSelectingEventArgs _
Inherits SqlDataSourceCommandEventArgs
public class SqlDataSourceSelectingEventArgs : SqlDataSourceCommandEventArgs
public ref class SqlDataSourceSelectingEventArgs : public SqlDataSourceCommandEventArgs
type SqlDataSourceSelectingEventArgs =
class
inherit SqlDataSourceCommandEventArgs
end
Le type SqlDataSourceSelectingEventArgs expose les membres suivants.

Constructeurs

Propriétés

Méthodes

Notes
En ajoutant un délégué de gestionnaire d'événements pour gérer l'événement Selecting, vous pouvez exécuter tout prétraitement supplémentaire requis ou annuler totalement la requête de base de données. La classe SqlDataSourceSelectingEventArgs étant dérivée de la classe SqlDataSourceCommandEventArgs, vous pouvez annuler une requête de base de données SqlDataSource en attente en attribuant la valeur true à la propriété Cancel. Vous pouvez examiner et manipuler CommandText, la collection Parameters et d'autres propriétés de requête de base de données avant d'exécuter la requête en accédant à l'objet DbCommand exposé par la propriété Command. Vous pouvez également examiner l'objet DataSourceSelectArguments qui est passé à la méthode Select en accédant à la propriété Arguments. La classe SqlDataSourceSelectingEventArgs est utilisée dans la méthode OnSelecting pour fournir l'accès à une requête de base de données SqlDataSource avant qu'elle soit exécutée. Le contrôle SqlDataSource expose beaucoup d'événements que vous pouvez gérer pour travailler avec les objets de données sous-jacents pendant le déroulement d'une opération de données. Le tableau suivant répertorie les événements et les classes EventArgs et délégués de gestionnaires d'événements associés.

Informations de version
.NET FrameworkPris en charge dans : 4, 3.5, 3.0, 2.0

Plateformes
Windows 7, Windows Vista SP1 ou ultérieur, Windows XP SP3, Windows XP SP2 Édition x64, Windows Server 2008 (installation minimale non prise en charge), Windows Server 2008 R2 (installation minimale prise en charge avec SP1 ou version ultérieure), Windows Server 2003 SP2
Le .NET Framework ne prend pas en charge toutes les versions de chaque plateforme. Pour obtenir la liste des versions prises en charge, consultez Configuration requise du .NET Framework.

Sécurité des threads
Tous les membres static ( Shared en Visual Basic) publics de ce type sont thread-safe. Il n'est pas garanti que les membres d'instance soient thread-safe.

Voir aussi
|