Suggérer une traduction
 
Suggestions d'autres utilisateurs :

progress indicator
Aucune autre suggestion.
Cliquez pour évaluer et commenter
MSDN
MSDN Library
Développement .NET
.NET Framework 4
Espaces de noms System.Web
System.Web.UI.WebControls
SqlDataSourceView, classe
Réduire tout/Développer tout Réduire tout
Affichage du contenu :  côte à côteAffichage du contenu : côte à côte
.NET Framework Class Library
SqlDataSourceView Class

Supports the SqlDataSource control and provides an interface for data-bound controls to perform SQL data operations against relational databases.

System..::.Object
  System.Web.UI..::.DataSourceView
    System.Web.UI.WebControls..::.SqlDataSourceView
      System.Web.UI.WebControls..::.AccessDataSourceView

Namespace:  System.Web.UI.WebControls
Assembly:  System.Web (in System.Web.dll)
Visual Basic
Public Class SqlDataSourceView _
    Inherits DataSourceView _
    Implements IStateManager
C#
public class SqlDataSourceView : DataSourceView, 
    IStateManager
Visual C++
public ref class SqlDataSourceView : public DataSourceView, 
    IStateManager
F#
type SqlDataSourceView =  
    class
        inherit DataSourceView
        interface IStateManager
    end

The SqlDataSourceView type exposes the following members.

  NameDescription
Public methodSqlDataSourceViewInitializes a new instance of the SqlDataSourceView class setting the specified SqlDataSource control as the owner of the current view.
Top
  NameDescription
Public propertyCancelSelectOnNullParameterGets or sets a value indicating whether a data retrieval operation is canceled when any parameter that is contained in the SelectParameters collection evaluates to nullNothingnullptra null reference (Nothing in Visual Basic).
Public propertyCanDeleteGets a value indicating whether the SqlDataSourceView object that is associated with the current SqlDataSource control supports the delete operation. (Overrides DataSourceView..::.CanDelete.)
Public propertyCanInsertGets a value indicating whether the SqlDataSourceView object that is associated with the current SqlDataSource control supports the insert operation. (Overrides DataSourceView..::.CanInsert.)
Public propertyCanPageGets a value indicating whether the SqlDataSourceView object that is associated with the current SqlDataSource control supports the paging of retrieved data. (Overrides DataSourceView..::.CanPage.)
Public propertyCanRetrieveTotalRowCountGets a value indicating whether the SqlDataSourceView object that is associated with the current SqlDataSource control supports retrieving the total number of data rows, in addition to the set of data. (Overrides DataSourceView..::.CanRetrieveTotalRowCount.)
Public propertyCanSortGets a value indicating whether the SqlDataSourceView object that is associated with the current SqlDataSource control supports a sorted view on the retrieved data. (Overrides DataSourceView..::.CanSort.)
Public propertyCanUpdateGets a value indicating whether the SqlDataSourceView object that is associated with the current SqlDataSource control supports the update operation. (Overrides DataSourceView..::.CanUpdate.)
Public propertyConflictDetectionGets or sets the value indicating how the SqlDataSource control performs updates and deletes when data in a row in the underlying database changes during the time of the operation.
Public propertyDeleteCommandGets or sets the SQL string that the SqlDataSourceView uses to delete data from the underlying database.
Public propertyDeleteCommandTypeGets or sets a value indicating whether the text in the DeleteCommand property is a SQL statement or the name of a stored procedure.
Public propertyDeleteParametersGets the parameters collection containing the parameters that are used by the DeleteCommand property.
Protected propertyEventsGets a list of event-handler delegates for the data source view. (Inherited from DataSourceView.)
Public propertyFilterExpressionGets or sets a filtering expression that is applied when the Select method is called.
Public propertyFilterParametersGets a collection of parameters that are associated with any parameter placeholders in the FilterExpression string.
Public propertyInsertCommandGets or sets the SQL string that the SqlDataSourceView object uses to insert data into the underlying database.
Public propertyInsertCommandTypeGets or sets a value indicating whether the text in the InsertCommand property is a SQL statement or the name of a stored procedure.
Public propertyInsertParametersGets the parameters collection containing the parameters that are used by the InsertCommand property.
Protected propertyIsTrackingViewStateGets a value indicating whether the SqlDataSourceView object is saving changes to its view state.
Public propertyNameGets the name of the data source view. (Inherited from DataSourceView.)
Public propertyOldValuesParameterFormatStringGets or sets a format string to apply to the names of any parameters that are passed to the Delete or Update method.
Protected propertyParameterPrefixGets the string that is used to prefix a parameter placeholder in a parameterized SQL query.
Public propertySelectCommandGets or sets the SQL string that the SqlDataSourceView object uses to retrieve data from the underlying database.
Public propertySelectCommandTypeGets or sets a value indicating whether the text in the SelectCommand property is a SQL query or the name of a stored procedure.
Public propertySelectParametersGets the parameters collection containing the parameters that are used by the SelectCommand property.
Public propertySortParameterNameGets or sets the name of a stored procedure parameter that is used to sort retrieved data when data retrieval is performed using a stored procedure.
Public propertyUpdateCommandGets or sets the SQL string that the SqlDataSourceView object uses to update data in the underlying database.
Public propertyUpdateCommandTypeGets or sets a value indicating whether the text in the UpdateCommand property is a SQL statement or the name of a stored procedure.
Public propertyUpdateParametersGets the parameters collection containing the parameters that are used by the UpdateCommand property.
Top
  NameDescription
Public methodCanExecuteDetermines whether the specified command can be executed. (Inherited from DataSourceView.)
Public methodDelete(IDictionary, IDictionary)Performs a delete operation using the DeleteCommand SQL string, any parameters that are specified in the DeleteParameters collection, and the values that are in the specified keys and oldValues collections.
Public methodDelete(IDictionary, IDictionary, DataSourceViewOperationCallback)Performs an asynchronous delete operation on the list of data that the DataSourceView object represents. (Inherited from DataSourceView.)
Public methodEquals(Object)Determines whether the specified Object is equal to the current Object. (Inherited from Object.)
Protected methodExecuteCommand(String, IDictionary, IDictionary)Executes the specified command. (Inherited from DataSourceView.)
Public methodExecuteCommand(String, IDictionary, IDictionary, DataSourceViewOperationCallback)Executes the specified command. (Inherited from DataSourceView.)
Protected methodExecuteDeletePerforms a delete operation using the DeleteCommand SQL string, any parameters that are specified in the DeleteParameters collection, and the values that are in the specified keys and oldValues collections. (Overrides DataSourceView..::.ExecuteDelete(IDictionary, IDictionary).)
Protected methodExecuteInsertPerforms an insert operation using the InsertCommand SQL string, any parameters that are specified in the InsertParameters collection, and the values that are in the specified values collection. (Overrides DataSourceView..::.ExecuteInsert(IDictionary).)
Protected methodExecuteSelectRetrieves data from the underlying database using the SelectCommand SQL string and any parameters that are in the SelectParameters collection. (Overrides DataSourceView..::.ExecuteSelect(DataSourceSelectArguments).)
Protected methodExecuteUpdatePerforms an update operation using the UpdateCommand SQL string, any parameters that are in the UpdateParameters collection, and the values that are in the specified keys, values, and oldValues collections. (Overrides DataSourceView..::.ExecuteUpdate(IDictionary, IDictionary, IDictionary).)
Protected methodFinalizeAllows an object to try to free resources and perform other cleanup operations before it is reclaimed by garbage collection. (Inherited from Object.)
Public methodGetHashCodeServes as a hash function for a particular type. (Inherited from Object.)
Public methodGetTypeGets the Type of the current instance. (Inherited from Object.)
Public methodInsert(IDictionary)Performs an insert operation using the InsertCommand SQL string, any parameters that are specified in the InsertParameters collection, and the values that are in the specified values collection.
Public methodInsert(IDictionary, DataSourceViewOperationCallback)Performs an asynchronous insert operation on the list of data that the DataSourceView object represents. (Inherited from DataSourceView.)
Protected methodLoadViewStateRestores the previously saved view state for the data source view.
Protected methodMemberwiseCloneCreates a shallow copy of the current Object. (Inherited from Object.)
Protected methodOnDataSourceViewChangedRaises the DataSourceViewChanged event. (Inherited from DataSourceView.)
Protected methodOnDeletedRaises the Deleted event after the SqlDataSource control has completed a delete operation.
Protected methodOnDeletingRaises the Deleting event before the SqlDataSource control attempts a delete operation.
Protected methodOnFilteringRaises the Filtering event before the SqlDataSource control filters the results of a select operation.
Protected methodOnInsertedRaises the Inserted event after the SqlDataSource control has completed an insert operation.
Protected methodOnInsertingRaises the Inserting event before the SqlDataSource control attempts an insert operation.
Protected methodOnSelectedRaises the Selected event after the SqlDataSource control has completed a data retrieval operation.
Protected methodOnSelectingRaises the Selecting event before the SqlDataSource control attempts a data retrieval operation.
Protected methodOnUpdatedRaises the Updated event after the SqlDataSource control has completed an update operation.
Protected methodOnUpdatingRaises the Updating event before the SqlDataSource control attempts an update operation.
Protected methodRaiseUnsupportedCapabilityErrorCompares the capabilities that are requested for an ExecuteSelect operation against those that the view supports and is called by the RaiseUnsupportedCapabilitiesError method. (Overrides DataSourceView..::.RaiseUnsupportedCapabilityError(DataSourceCapabilities).)
Protected methodSaveViewStateSaves the changes to the view state for the SqlDataSourceView control since the time that the page was posted back to the server.
Public methodSelect(DataSourceSelectArguments)Retrieves data from the underlying database using the SelectCommand SQL string and any parameters that are in the SelectParameters collection.
Public methodSelect(DataSourceSelectArguments, DataSourceViewSelectCallback)Gets a list of data asynchronously from the underlying data storage. (Inherited from DataSourceView.)
Public methodToStringReturns a string that represents the current object. (Inherited from Object.)
Protected methodTrackViewStateCauses the SqlDataSourceView object to track changes to its view state so that the changes can be stored in the StateBag object for the control and persisted across requests for the same page.
Public methodUpdate(IDictionary, IDictionary, IDictionary)Performs an update operation using the UpdateCommand SQL string, any parameters that are in the UpdateParameters collection, and the values that are in the specified keys, values, and oldValues collections.
Public methodUpdate(IDictionary, IDictionary, IDictionary, DataSourceViewOperationCallback)Performs an asynchronous update operation on the list of data that the DataSourceView object represents. (Inherited from DataSourceView.)
Top
  NameDescription
Public eventDataSourceViewChangedOccurs when the data source view has changed. (Inherited from DataSourceView.)
Public eventDeletedOccurs when a delete operation has completed.
Public eventDeletingOccurs before a delete operation.
Public eventFilteringOccurs before a filter operation.
Public eventInsertedOccurs when an insert operation has completed.
Public eventInsertingOccurs before an insert operation.
Public eventSelectedOccurs when a data retrieval operation has completed.
Public eventSelectingOccurs before a data retrieval operation.
Public eventUpdatedOccurs when an update operation has completed.
Public eventUpdatingOccurs before an update operation.
Top
  NameDescription
Explicit interface implemetationPrivate propertyIStateManager..::.IsTrackingViewStateFor a description of this member, see IsTrackingViewState.
Explicit interface implemetationPrivate methodIStateManager..::.LoadViewStateInfrastructure. For a description of this member, see IStateManager..::.LoadViewState(Object).
Explicit interface implemetationPrivate methodIStateManager..::.SaveViewStateInfrastructure. For a description of this member, see IStateManager..::.SaveViewState()()().
Explicit interface implemetationPrivate methodIStateManager..::.TrackViewStateInfrastructure. For a description of this member, see TrackViewState.
Top

The SqlDataSourceView class is intended primarily to be used by data-bound controls, and not as a programmable object in page code.

ASP.NET data source controls contain one or more lists of data, represented by data source view objects. The SqlDataSourceView class extends the DataSourceView class, defines the capabilities of the SqlDataSource control with which it is associated, and implements the basic data functionality for the data source control. The SqlDataSourceView class implements the data functionality for the SqlDataSource control, including the Select, Update, Insert, and Delete operations, sorting, filtering, and managing settings that are kept in view state.

Although the SqlDataSourceView object is not directly exposed to page developers by the SqlDataSource control, many of its properties are. The most basic operation that a data source view performs is data retrieval from the underlying database using the Select method, which retrieves an IEnumerable collection of data items. The SqlDataSourceView class implements data retrieval from relational databases using SQL queries. The SQL queries can be parameterized for greater flexibility and security. The following data retrieval methods, properties, and events are implemented by the SqlDataSourceView and exposed directly by its SqlDataSource control to page developers and other callers:

The SqlDataSourceView object supports updating data in a relational database using SQL commands. The SQL commands can be parameterized for greater flexibility and security. Data-bound controls, such as the GridView and DetailsView, can be configured to perform updates automatically using the SqlDataSourceView, while other controls cannot. The following update methods, properties, and events are implemented by the SqlDataSourceView and exposed directly by its SqlDataSource control to page developers and other callers:

The SqlDataSourceView supports inserting new rows of data into a relational database. The SQL commands that are specified in the InsertCommand property can be parameterized for greater flexibility and security. Data-bound controls, such as the GridView and DetailsView, can be configured to perform inserts automatically using the SqlDataSourceView, while other controls cannot. The following insert methods, properties, and events are implemented by the SqlDataSourceView and exposed directly by its SqlDataSource control to page developers and other callers:

The SqlDataSourceView object also supports deleting data from a relational database. As with other commands, the SQL commands that are specified in the DeleteCommand property can be parameterized for greater flexibility and security. Data-bound controls, such as the GridView and DetailsView, can be configured to perform deletes automatically using the SqlDataSourceView, while other controls cannot. The following delete methods, properties, and events are implemented by the SqlDataSourceView and exposed directly by its SqlDataSource control to page developers and other callers:

Data retrieval is more powerful when the clause that is used to filter the data during data retrieval is dynamic. In other words, an SQL query with a static WHERE clause is not as flexible and powerful as an SQL query where the values in the WHERE clause are bound to values that can change, such as values that are displayed in controls on a Web Forms page. Instead of rebuilding an SQL query and setting the SelectCommand property on every page load, you can use the FilterExpression and FilterParameters properties to apply dynamic filtering to data retrieval. These properties are implemented by the SqlDataSourceView and exposed directly by its SqlDataSource control to data-bound controls and other callers.

You can sort the data that you retrieve with the SqlDataSource control by adding an ORDER BY clause, which causes the database to perform the ordering for you when you retrieve data or by ordering the data in memory after it is retrieved. You can supply a sorting expression to the SqlDataSourceView by setting the SortExpression property of the DataSourceSelectArguments object that is passed to the Select method. The syntax for the SortExpression property is the same as the syntax for a DataView..::.Sort property. If you use a stored procedure to retrieve data, you can also use the SortParameterName property to specify a parameter that is used specifically for sorting the results of a stored procedure call.

When more than one user can change the database concurrently, there is the potential for concurrency conflict. The SqlDataSource control has controls concurrency through the SqlDataSource..::.ConflictDetection property. The functionality is implemented in the SqlDataSourceView..::.ConflictDetection property.

Like many other Web server controls, the SqlDataSourceView implements the IStateManager interface and uses view state to track its state across page requests. Implementations of the IsTrackingViewState and property and the LoadViewState, SaveViewState, and TrackViewState methods are provided to enable view state tracking for the control. For more information, see ASP.NET State Management Overview.

.NET Framework

Supported in: 4, 3.5, 3.0, 2.0

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.
Any public static (Shared in Visual Basic) members of this type are thread safe. Any instance members are not guaranteed to be thread safe.
Bibliothèque de classes .NET Framework
SqlDataSourceView, classe

Prend en charge le contrôle SqlDataSource et fournit une interface pour les contrôles liés aux données pour exécuter des opérations de données SQL sur des bases de données relationnelles.

System..::.Object
  System.Web.UI..::.DataSourceView
    System.Web.UI.WebControls..::.SqlDataSourceView
      System.Web.UI.WebControls..::.AccessDataSourceView

Espace de noms :  System.Web.UI.WebControls
Assembly :  System.Web (dans System.Web.dll)
Visual Basic
Public Class SqlDataSourceView _
    Inherits DataSourceView _
    Implements IStateManager
C#
public class SqlDataSourceView : DataSourceView, 
    IStateManager
VisualC++
public ref class SqlDataSourceView : public DataSourceView, 
    IStateManager
F#
type SqlDataSourceView =  
    class
        inherit DataSourceView
        interface IStateManager
    end

Le type SqlDataSourceView expose les membres suivants.

  NomDescription
Méthode publiqueSqlDataSourceViewInitialise une nouvelle instance de la classe SqlDataSourceView définissant le contrôle SqlDataSource spécifié en tant que propriétaire de l'affichage actuel.
Début
  NomDescription
Propriété publiqueCancelSelectOnNullParameterObtient ou définit une valeur indiquant si une opération de récupération de données est annulée lorsque tout paramètre qui est contenu dans la collection SelectParameters est égal à nullNothingnullptrune référence null (Nothing en Visual Basic).
Propriété publiqueCanDeleteObtient une valeur indiquant si l'objet SqlDataSourceView qui est associé au contrôle SqlDataSource en cours prend en charge l'opération de suppression. (Substitue DataSourceView..::.CanDelete.)
Propriété publiqueCanInsertObtient une valeur indiquant si l'objet SqlDataSourceView qui est associé au contrôle SqlDataSource en cours prend en charge l'opération d'insertion. (Substitue DataSourceView..::.CanInsert.)
Propriété publiqueCanPageObtient une valeur indiquant si l'objet SqlDataSourceView qui est associé au contrôle SqlDataSource en cours prend en charge la pagination de données récupérées. (Substitue DataSourceView..::.CanPage.)
Propriété publiqueCanRetrieveTotalRowCountObtient une valeur indiquant si l'objet SqlDataSourceView qui est associé au contrôle SqlDataSource en cours prend en charge la récupération du nombre total de lignes en plus du groupe de données. (Substitue DataSourceView..::.CanRetrieveTotalRowCount.)
Propriété publiqueCanSortObtient une valeur indiquant si l'objet SqlDataSourceView qui est associé au contrôle SqlDataSource en cours prend en charge une vue triée sur les données récupérées. (Substitue DataSourceView..::.CanSort.)
Propriété publiqueCanUpdateObtient une valeur indiquant si l'objet SqlDataSourceView qui est associé au contrôle SqlDataSource en cours prend en charge l'opération de mise à jour. (Substitue DataSourceView..::.CanUpdate.)
Propriété publiqueConflictDetectionObtient ou définit la valeur indiquant comment le contrôle SqlDataSource exécute des mises à jour et des suppressions lorsque des données dans une ligne de la base de données sous-jacente sont modifiées au cours de l'opération.
Propriété publiqueDeleteCommandObtient ou définit la chaîne SQL que SqlDataSourceView utilise pour supprimer des données de la base de données sous-jacente.
Propriété publiqueDeleteCommandTypeObtient ou définit une valeur indiquant si le texte de la propriété DeleteCommand est une instruction SQL ou le nom d'une procédure stockée.
Propriété publiqueDeleteParametersObtient la collection de paramètres contenant les paramètres qui sont utilisés par la propriété DeleteCommand.
Propriété protégéeEventsObtient la liste des délégués de gestion d'événements pour l'affichage de source de données. (Hérité de DataSourceView.)
Propriété publiqueFilterExpressionObtient ou définit une expression de filtrage qui est appliquée lorsque la méthode Select est appelée.
Propriété publiqueFilterParametersObtient une collection de paramètres qui sont associés aux espaces réservés des paramètres dans la chaîne FilterExpression.
Propriété publiqueInsertCommandObtient ou définit la chaîne SQL que l'objet SqlDataSourceView utilise pour insérer des données dans la base de données sous-jacente.
Propriété publiqueInsertCommandTypeObtient ou définit une valeur indiquant si le texte de la propriété InsertCommand est une instruction SQL ou le nom d'une procédure stockée.
Propriété publiqueInsertParametersObtient la collection de paramètres contenant les paramètres qui sont utilisés par la propriété InsertCommand.
Propriété protégéeIsTrackingViewStateObtient une valeur indiquant si l'objet SqlDataSourceView enregistre les modifications apportées à son état d'affichage.
Propriété publiqueNameObtient le nom de l'affichage de source de données. (Hérité de DataSourceView.)
Propriété publiqueOldValuesParameterFormatStringObtient ou définit une chaîne de mise en forme à appliquer aux noms de tous les paramètres qui sont passés à la méthode Delete ou Update.
Propriété protégéeParameterPrefixObtient la chaîne qui est utilisée pour préfixer un espace réservé de paramètre dans une requête SQL paramétrée.
Propriété publiqueSelectCommandObtient ou définit la chaîne SQL que l'objet SqlDataSourceView utilise pour récupérer des données de la base de données sous-jacente.
Propriété publiqueSelectCommandTypeObtient ou définit une valeur indiquant si le texte de la propriété SelectCommand est une requête SQL ou le nom d'une procédure stockée.
Propriété publiqueSelectParametersObtient la collection de paramètres contenant les paramètres qui sont utilisés par la propriété SelectCommand.
Propriété publiqueSortParameterNameObtient ou définit le nom d'un paramètre de procédure stockée qui est utilisé pour trier des données récupérées lorsque la récupération de données est exécutée à l'aide d'une procédure stockée.
Propriété publiqueUpdateCommandObtient ou définit la chaîne SQL que l'objet SqlDataSourceView utilise pour mettre à jour des données de la base de données sous-jacente.
Propriété publiqueUpdateCommandTypeObtient ou définit une valeur indiquant si le texte de la propriété UpdateCommand est une instruction SQL ou le nom d'une procédure stockée.
Propriété publiqueUpdateParametersObtient la collection de paramètres contenant les paramètres qui sont utilisés par la propriété UpdateCommand.
Début
  NomDescription
Méthode publiqueCanExecuteDétermine si la commande spécifiée peut être exécutée. (Hérité de DataSourceView.)
Méthode publiqueDelete(IDictionary, IDictionary)Exécute une opération de suppression à l'aide de la chaîne DeleteCommand SQL, de tout paramètre spécifié dans la collection DeleteParameters et des valeurs dans les keys et collections oldValues spécifiées.
Méthode publiqueDelete(IDictionary, IDictionary, DataSourceViewOperationCallback)Exécute une opération de suppression asynchrone sur la liste des données que l'objet DataSourceView représente. (Hérité de DataSourceView.)
Méthode publiqueEquals(Object)Détermine si l'Object spécifié est égal à l'Object en cours. (Hérité de Object.)
Méthode protégéeExecuteCommand(String, IDictionary, IDictionary)Exécute la commande spécifiée. (Hérité de DataSourceView.)
Méthode publiqueExecuteCommand(String, IDictionary, IDictionary, DataSourceViewOperationCallback)Exécute la commande spécifiée. (Hérité de DataSourceView.)
Méthode protégéeExecuteDeleteExécute une opération de suppression à l'aide de la chaîne DeleteCommand SQL, de tout paramètre spécifié dans la collection DeleteParameters et des valeurs dans les keys et collections oldValues spécifiées. (Substitue DataSourceView..::.ExecuteDelete(IDictionary, IDictionary).)
Méthode protégéeExecuteInsertExécute une opération d'insertion à l'aide de la chaîne InsertCommand SQL, de tout paramètre spécifié dans la collection InsertParameters et des valeurs dans la collection values spécifiée. (Substitue DataSourceView..::.ExecuteInsert(IDictionary).)
Méthode protégéeExecuteSelectRécupère des données de la base de données sous-jacente à l'aide de la chaîne SQL SelectCommand et des paramètres de la collection SelectParameters. (Substitue DataSourceView..::.ExecuteSelect(DataSourceSelectArguments).)
Méthode protégéeExecuteUpdateExécute une opération de mise à jour à l'aide de la chaîne UpdateCommand SQL, tout paramètre de la collection UpdateParameters ainsi que les valeurs se trouvant dans les collections keys, values et oldValues spécifiées. (Substitue DataSourceView..::.ExecuteUpdate(IDictionary, IDictionary, IDictionary).)
Méthode protégéeFinalizeAutorise un objet à tenter de libérer des ressources et d'exécuter d'autres opérations de netto***ge avant qu'il ne soit récupéré par l'opération garbage collection. (Hérité de Object.)
Méthode publiqueGetHashCodeSert de fonction de hachage pour un type particulier. (Hérité de Object.)
Méthode publiqueGetTypeObtient le Type de l'instance actuelle. (Hérité de Object.)
Méthode publiqueInsert(IDictionary)Exécute une opération d'insertion à l'aide de la chaîne InsertCommand SQL, de tout paramètre spécifié dans la collection InsertParameters et des valeurs qui se trouvent dans la collection values spécifiée.
Méthode publiqueInsert(IDictionary, DataSourceViewOperationCallback)Exécute une opération d'insertion asynchrone dans la liste des données que l'objet DataSourceView représente. (Hérité de DataSourceView.)
Méthode protégéeLoadViewStateRestaure l'état d'affichage enregistré précédemment pour la vue de source de données.
Méthode protégéeMemberwiseCloneCrée une copie superficielle de l'objet Object actif. (Hérité de Object.)
Méthode protégéeOnDataSourceViewChangedDéclenche l'événement DataSourceViewChanged. (Hérité de DataSourceView.)
Méthode protégéeOnDeletedDéclenche l'événement Deleted après que le contrôle SqlDataSource a complété une opération de suppression.
Méthode protégéeOnDeletingDéclenche l'événement Deleting avant que le contrôle SqlDataSource ne tente une opération de suppression.
Méthode protégéeOnFilteringDéclenche l'événement Filtering avant que le contrôle SqlDataSource ne filtre les résultats d'une opération de sélection.
Méthode protégéeOnInsertedDéclenche l'événement Inserted après que le contrôle SqlDataSource a complété une opération d'insertion.
Méthode protégéeOnInsertingDéclenche l'événement Inserting avant que le contrôle SqlDataSource ne tente une opération d'insertion.
Méthode protégéeOnSelectedDéclenche l'événement Selected après que le contrôle SqlDataSource a complété une opération de récupération.
Méthode protégéeOnSelectingDéclenche l'événement Selecting avant que le contrôle SqlDataSource ne tente une opération de récupération.
Méthode protégéeOnUpdatedDéclenche l'événement Updated après que le contrôle SqlDataSource a complété une opération de mise à jour.
Méthode protégéeOnUpdatingDéclenche l'événement Updating avant que le contrôle SqlDataSource ne tente une opération de mise à jour.
Méthode protégéeRaiseUnsupportedCapabilityErrorCompare les fonctions demandées pour une opération ExecuteSelect avec celles prises en charge par l'affichage et est appelé par la méthode RaiseUnsupportedCapabilitiesError. (Substitue DataSourceView..::.RaiseUnsupportedCapabilityError(DataSourceCapabilities).)
Méthode protégéeSaveViewStateEnregistre les modifications apportées à l'état d'affichage du contrôle SqlDataSourceView depuis la publication de la page sur le serveur.
Méthode publiqueSelect(DataSourceSelectArguments)Récupère des données de la base de données sous-jacente à l'aide de la chaîne SQL SelectCommand et des paramètres de la collection SelectParameters.
Méthode publiqueSelect(DataSourceSelectArguments, DataSourceViewSelectCallback)Obtient une liste de données en mode asynchrone provenant du stockage des données sous-jacent. (Hérité de DataSourceView.)
Méthode publiqueToStringRetourne une chaîne qui représente l'objet actuel. (Hérité de Object.)
Méthode protégéeTrackViewStateAinsi, l'objet SqlDataSourceView effectue le suivi des modifications de son état d'affichage afin qu'elles puissent être stockées dans l'objet StateBag du contrôle et être persistantes entre les requêtes de la même page.
Méthode publiqueUpdate(IDictionary, IDictionary, IDictionary)Exécute une opération de mise à jour à l'aide de la chaîne UpdateCommand SQL, tout paramètre de la collection UpdateParameters ainsi que les valeurs se trouvant dans les collections keys, values et oldValues spécifiées.
Méthode publiqueUpdate(IDictionary, IDictionary, IDictionary, DataSourceViewOperationCallback)Exécute une opération de mise à jour asynchrone dans la liste des données que l'objet DataSourceView représente. (Hérité de DataSourceView.)
Début
  NomDescription
Événement publicDataSourceViewChangedSe produit lorsque l'affichage de source de données a été modifié. (Hérité de DataSourceView.)
Événement publicDeletedSe produit lorsqu'une opération de suppression est terminée.
Événement publicDeletingSe produit avant une opération de suppression.
Événement publicFilteringSe produit avant une opération de filtre.
Événement publicInsertedSe produit lorsqu'une opération d'insertion est terminée.
Événement publicInsertingSe produit avant une opération d'insertion.
Événement publicSelectedSe produit lorsqu'une opération de récupération de données est terminée.
Événement publicSelectingSe produit avant une opération de récupération de données.
Événement publicUpdatedSe produit lorsqu'une opération de mise à jour est terminée.
Événement publicUpdatingSe produit avant une opération de mise à jour.
Début
  NomDescription
Implémentation d'interface explicitePropriété privéeIStateManager..::.IsTrackingViewStatePour une description de ce membre, consultez IsTrackingViewState.
Implémentation d'interface expliciteMéthode privéeIStateManager..::.LoadViewStateInfrastructure. Pour une description de ce membre, consultez IStateManager..::.LoadViewState(Object).
Implémentation d'interface expliciteMéthode privéeIStateManager..::.SaveViewStateInfrastructure. Pour une description de ce membre, consultez IStateManager..::.SaveViewState()()().
Implémentation d'interface expliciteMéthode privéeIStateManager..::.TrackViewStateInfrastructure. Pour une description de ce membre, consultez TrackViewState.
Début

La classe SqlDataSourceView est projetée à l'origine pour être utilisé par les contrôles liés aux données et non en tant qu'objet programmable dans le code de page.

Les contrôles de source de données ASP.NET contiennent une ou plusieurs listes de données, représentées par les objets de vue de source de données. La classe SqlDataSourceView étend la classe DataSourceView, définit les fonctions du contrôle SqlDataSource auquel il est associé et implémente les fonctionnalités de données de base pour le contrôle de source de données. La classe SqlDataSourceView implémente les fonctionnalités de données pour le contrôle SqlDataSource, y compris les opérations Select, Update, Insert et Delete, les paramètres de tri, filtrage et gestion qui sont conservés dans l'état d'affichage.

Bien que l'objet SqlDataSourceView ne soit pas exposé directement aux développeurs de pages par le contrôle SqlDataSource, bon nombre de ses propriétés le sont. L'opération la plus fondamentale qu'une vue de source de données exécute est la récupération de données de la base de données sous-jacente à l'aide de la méthode Select qui récupère une collection IEnumerable d'éléments de données. La classe SqlDataSourceView implémente la récupération de données de bases de données relationnelles à l'aide de requêtes SQL. Les requêtes SQL peuvent être paramétrées pour plus de souplesse et de sécurité. Les méthodes, propriétés et événements de récupération des données suivants sont implémentés par SqlDataSourceView et sont exposés directement par son contrôle SqlDataSource aux développeurs de pages et aux autres appelants :

L'objet SqlDataSourceView prend en charge la mise à jour de données dans une base de données relationnelle à l'aide de commandes SQL. Les commandes SQL peuvent être paramétrées pour plus de souplesse et de sécurité. Les contrôles liés aux données, tels que GridView et DetailsView, peuvent être configurés pour effectuer des mises à jour automatiquement à l'aide de SqlDataSourceView, alors que d'autres contrôles ne le peuvent pas. Les méthodes, propriétés et événements de mise à jour suivants sont implémentés par SqlDataSourceView et sont exposés directement par son contrôle SqlDataSource aux développeurs de pages et aux autres appelants :

SqlDataSourceView prend en charge l'insertion des nouvelles lignes de données dans une base de données relationnelle. Les commandes SQL qui sont spécifiées dans la propriété InsertCommand peuvent être paramétrées pour plus de souplesse et de sécurité. Les contrôles liés aux données, tels que GridView et DetailsView, peuvent être configurés pour effectuer des insertions automatiquement à l'aide de SqlDataSourceView, alors que d'autres contrôles ne le peuvent pas. Les méthodes, propriétés et événements d'insertion suivants sont implémentés par SqlDataSourceView et sont exposés directement par son contrôle SqlDataSource aux développeurs de pages et aux autres appelants :

L'objet SqlDataSourceView prend également en charge la suppression de données dans une base de données relationnelle. Comme avec d'autres commandes, les commandes SQL qui sont spécifiées dans la propriété DeleteCommand peuvent être paramétrées pour plus de souplesse et de sécurité. Les contrôles liés aux données, tels que GridView et DetailsView, peuvent être configurés pour effectuer des suppressions automatiquement à l'aide de SqlDataSourceView, alors que d'autres contrôles ne le peuvent pas. Les méthodes, propriétés et événements de suppression suivants sont implémentés par SqlDataSourceView et sont exposés directement par son contrôle SqlDataSource aux développeurs de pages et aux autres appelants :

La récupération de données est plus puissante lorsque la clause qui est utilisée pour filtrer les données pendant la récupération de données est dynamique. En d'autres termes, une requête SQL avec une clause WHERE statique n'est pas aussi flexible et puissante qu'une requête SQL où les valeurs dans la clause WHERE sont liées aux valeurs qui peuvent changer, telles que les valeurs qui sont affichées dans les contrôles dans une page Web Forms. Au lieu de reconstituer une requête SQL et de définir la propriété SelectCommand à chaque chargement de la page, vous pouvez utiliser les propriétés FilterExpression et FilterParameters pour appliquer un filtrage dynamique à la récupération de données. Ces propriétés sont implémentées par SqlDataSourceView et sont exposées directement par son contrôle SqlDataSource aux contrôles liés aux données et aux autres appelants.

Vous pouvez trier les données que vous récupérez avec le contrôle SqlDataSource en ajoutant une clause ORDER BY qui déclenche l'exécution du classement par la base de données lorsque vous récupérez des données ou en triant les données en mémoire après leur récupération. Vous pouvez fournir une expression de tri à SqlDataSourceView en définissant la propriété SortExpression de l'objet DataSourceSelectArguments qui est passé à la méthode Select. La syntaxe pour la propriété SortExpression est la même que celle d'une propriété DataView..::.Sort. Si vous utilisez une procédure stockée pour récupérer des données, vous pouvez également utiliser la propriété SortParameterName pour spécifier un paramètre qui est utilisé spécifiquement pour trier les résultats d'un appel de procédure stockée.

Lorsque plusieurs utilisateurs peuvent modifier la base de données simultanément, un conflit d'accès concurrentiel est possible. Le contrôle SqlDataSource contrôle l'accès concurrentiel via la propriété SqlDataSource..::.ConflictDetection. La fonctionnalité est implémentée dans la propriété SqlDataSourceView..::.ConflictDetection.

Comme de nombreux autres contrôles serveur Web, SqlDataSourceView implémente l'interface IStateManager et utilise l'état d'affichage pour que son état soit suivi au fil des requêtes de page. Les implémentations de la propriété IsTrackingViewState et des méthodes LoadViewState, SaveViewState et TrackViewState sont fournies pour activer l'état d'affichage qui suit le contrôle. Pour plus d'informations, consultez Vue d'ensemble de la gestion d'état ASP.NET.

.NET Framework

Pris en charge dans : 4, 3.5, 3.0, 2.0

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.
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.
Contenu de la communauté   Qu'est-ce que le Contenu de la communauté ?
Ajouter du contenu RSS  Annotations
Processing
© 2012 Microsoft. Tous droits réservés. Conditions d'utilisation | Marques | Confidentialité
Page view tracker