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
ObjectDataSourceView, 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
ObjectDataSourceView Class

Supports the ObjectDataSource control and provides an interface for data-bound controls to perform data operations with business and data objects.

System..::.Object
  System.Web.UI..::.DataSourceView
    System.Web.UI.WebControls..::.ObjectDataSourceView

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

The ObjectDataSourceView type exposes the following members.

  NameDescription
Public methodObjectDataSourceViewInitializes a new instance of the ObjectDataSourceView class.
Top
  NameDescription
Public propertyCanDeleteGets a value indicating whether the ObjectDataSourceView object that is associated with the current ObjectDataSource control supports the delete operation. (Overrides DataSourceView..::.CanDelete.)
Public propertyCanInsertGets a value indicating whether the ObjectDataSourceView object that is associated with the current ObjectDataSource control supports the insert operation. (Overrides DataSourceView..::.CanInsert.)
Public propertyCanPageGets a value indicating whether the ObjectDataSourceView object that is associated with the current ObjectDataSource control supports paging through the retrieved data. (Overrides DataSourceView..::.CanPage.)
Public propertyCanRetrieveTotalRowCountGets a value indicating whether the ObjectDataSourceView object that is associated with the current ObjectDataSource 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 ObjectDataSourceView object that is associated with the current ObjectDataSource control supports a sorted view on the underlying data source. (Overrides DataSourceView..::.CanSort.)
Public propertyCanUpdateGets a value indicating whether the ObjectDataSourceView object that is associated with the current ObjectDataSource control supports the update operation. (Overrides DataSourceView..::.CanUpdate.)
Public propertyConflictDetectionGets or sets a value that determines how the ObjectDataSource control performs updates and deletes when data in a row in the underlying data storage changes during the time of the operation.
Public propertyConvertNullToDBNullGets or sets a value indicating whether Parameter values that are passed to an update, insert, or delete operation are automatically converted from nullNothingnullptra null reference (Nothing in Visual Basic) to the Value value.
Public propertyDataObjectTypeNameGets or sets the name of a class that the ObjectDataSource control uses for a parameter in a data operation. The ObjectDataSource control uses the specified class instead of the Parameter objects that are in the various parameters collections.
Public propertyDeleteMethodGets or sets the name of the method or function that the ObjectDataSourceView object invokes to delete data.
Public propertyDeleteParametersGets the parameters collection that contains the parameters that are used by the DeleteMethod method.
Public propertyEnablePagingGets or sets a value indicating whether the data source control supports paging through the set of data that it retrieves.
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 business object method that is identified by the SelectMethod property is called.
Public propertyFilterParametersGets a collection of parameters that are associated with any parameter placeholders that are in the FilterExpression string.
Public propertyInsertMethodGets or sets the name of the method or function that the ObjectDataSourceView object invokes to insert data.
Public propertyInsertParametersGets the parameters collection that contains the parameters that are used by the InsertMethod method.
Protected propertyIsTrackingViewStateGets a value indicating whether the ObjectDataSourceView object is saving changes to its view state.
Public propertyMaximumRowsParameterNameGets or sets the name of the data retrieval method parameter that is used to indicate the number of records to retrieve for data source paging support.
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 the parameters for original values that are passed to the Delete or Update methods.
Public propertySelectCountMethodGets or sets the name of the method or function that the ObjectDataSourceView control invokes to retrieve a row count.
Public propertySelectMethodGets or sets the name of the method or function that the ObjectDataSourceView control invokes to retrieve data.
Public propertySelectParametersGets the parameters collection containing the parameters that are used by the SelectMethod method.
Public propertySortParameterNameGets or sets the name of the data retrieval method parameter that is used to specify a sort expression for data source sorting support.
Public propertyStartRowIndexParameterNameGets or sets the name of the data retrieval method parameter that is used to indicate the integer index of the first record to retrieve from the results set for data source paging support.
Public propertyTypeNameGets or sets the name of the class that the ObjectDataSource control represents.
Public propertyUpdateMethodGets or sets the name of the method or function that the ObjectDataSourceView object invokes to update data.
Public propertyUpdateParametersGets the parameters collection containing the parameters that are used by the UpdateMethod method.
Top
  NameDescription
Public methodCanExecuteDetermines whether the specified command can be executed. (Inherited from DataSourceView.)
Public methodDelete(IDictionary, IDictionary)Performs a delete operation by calling the business object method that is identified by the DeleteMethod property using 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 DeleteMethod method and the specified keys and oldValues collection. (Overrides DataSourceView..::.ExecuteDelete(IDictionary, IDictionary).)
Protected methodExecuteInsertPerforms an insert operation by calling the business object method that is identified by the InsertMethod property using the specified values collection. (Overrides DataSourceView..::.ExecuteInsert(IDictionary).)
Protected methodExecuteSelectRetrieves data from the object that is identified by the TypeName property by calling the method that is identified by the SelectMethod property and passing any values in the SelectParameters collection. (Overrides DataSourceView..::.ExecuteSelect(DataSourceSelectArguments).)
Protected methodExecuteUpdatePerforms an update operation by calling the method that is identified by the UpdateMethod property and using any parameters that are supplied in the keys, values, or 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 by calling the business object method that is identified by the InsertMethod property using 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 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 ObjectDataSourceView object has completed a delete operation.
Protected methodOnDeletingRaises the Deleting event before the ObjectDataSourceView object attempts a delete operation.
Protected methodOnFilteringRaises the Filtering event before the ObjectDataSourceView object attempts a filtering operation.
Protected methodOnInsertedRaises the Inserted event after the ObjectDataSourceView object has completed an insert operation.
Protected methodOnInsertingRaises the Inserting event before the ObjectDataSourceView object attempts an insert operation.
Protected methodOnObjectCreatedRaises the ObjectCreated event after the ObjectDataSourceView creates an instance of the object that is identified by the TypeName property.
Protected methodOnObjectCreatingRaises the ObjectCreating event before the ObjectDataSourceView object creates an instance of a business object to perform a data operation.
Protected methodOnObjectDisposingRaises the ObjectDisposing event before the ObjectDataSourceView object discards an instantiated type.
Protected methodOnSelectedRaises the Selected event after the ObjectDataSourceView object has completed a data retrieval operation.
Protected methodOnSelectingRaises the Selecting event before the ObjectDataSourceView object attempts a data retrieval operation.
Protected methodOnUpdatedRaises the Updated event after the ObjectDataSourceView object has completed an update operation.
Protected methodOnUpdatingRaises the Updating event before the ObjectDataSourceView object attempts an update operation.
Protected methodRaiseUnsupportedCapabilityErrorCalled by the RaiseUnsupportedCapabilitiesError method to compare the capabilities requested for an ExecuteSelect operation against those that the view supports. (Inherited from DataSourceView.)
Protected methodSaveViewStateSaves the changes to the view state for the ObjectDataSourceView object since the time when the page was posted back to the server.
Public methodSelect(DataSourceSelectArguments)Retrieves data from the object that is identified by the TypeName property by calling the method that is identified by the SelectMethod property and passing any values 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 ObjectDataSourceView object to track changes to its view state so that the changes can be stored in the ViewState object for the control and persisted across requests for the same page.
Public methodUpdate(IDictionary, IDictionary, IDictionary)Performs an update operation by calling the method that is identified by the UpdateMethod property and using any parameters that are supplied in the keys, values, or 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 eventObjectCreatedOccurs after the ObjectDataSourceView object creates an instance of the type that is identified by the TypeName property.
Public eventObjectCreatingOccurs before the ObjectDataSourceView object creates an instance of the type that is identified by the TypeName property.
Public eventObjectDisposingOccurs when the ObjectDataSourceView object discards an instance of an object that it has created.
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.
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 IStateManager..::.TrackViewState.
Top

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

The ObjectDataSourceView class implements the data functionality for the ObjectDataSource control, including the Select, Update, Delete, and Insert operations, sorting, filtering, and management of settings kept in view state.

A ObjectDataSourceView object is created for each instance of the ObjectDataSource class at run time. Calls to data operations of the instance of the ObjectDataSource class are handled by the instance of the ObjectDataSourceView object. Page developers do not access the instance of the ObjectDataSourceView class directly. Control developers can create custom data controls by extending the ObjectDataSource and ObjectDataSourceView classes.

The ObjectDataSourceView class performs data operations by calling methods on business or data objects using reflection. At run time, the ObjectDataSource control creates an instance of the type that is identified by the TypeName property, and then calls the appropriate method for the data operation. The instantiated object is not cached in memory by the ObjectDataSourceView. The object is created and destroyed for every data method call. If the method is static (Shared in Visual Basic), an instance is not created but the data operation method is still called.

The ObjectDataSourceView is not directly exposed to page developers by the ObjectDataSource control. Instead, the properties and methods of the ObjectDataSourceView are accessed through the ObjectDataSource. For example, the DeleteMethod of ObjectDataSourceView property is set by setting the DeleteMethod property of the ObjectDataSource.

Retrieving Data

The most basic operation that a data source view performs is data retrieval from the underlying data storage using the Select method, which retrieves an IEnumerable collection of data items. The following data retrieval methods, properties, and events are implemented by the ObjectDataSourceView object and exposed directly by its ObjectDataSource control to page developers and other callers:

Updating Data

The ObjectDataSourceView object supports data updates by calling a business or data object method that is identified by the UpdateMethod property. Data-bound controls that automatically perform updates, such as the GridView and DetailsView controls, pass their parameters in an IOrderedDictionary interface to the ObjectDataSourceView and the view object merges these parameters with any parameters that are found in the UpdateParameters collection.

The following update methods, properties, and events are implemented by the ObjectDataSourceView and exposed directly by its ObjectDataSource control to page developers and other callers:

Inserting Data

The ObjectDataSourceView object supports inserting new rows of data by calling a business or data object method that is identified by the InsertMethod property. Data-bound controls that automatically perform inserts, such as the GridView and DetailsView, pass their parameters in an IOrderedDictionary interface to the ObjectDataSourceView and the view object merges these parameters with any parameters that are found in the InsertParameters collection.

The following insert methods, properties, and events are implemented by the ObjectDataSourceView and exposed directly by its ObjectDataSource control to page developers and other callers:

Deleting Data

The ObjectDataSourceView object supports deleting data by calling a business or data object method that is identified by the DeleteMethod property. Data-bound controls that automatically perform deletes, such as the GridView and DetailsView, pass their parameters in an IOrderedDictionary interface to the ObjectDataSourceView and the view object merges these parameters with any parameters that are found in the DeleteParameters collection. The following delete methods, properties, and events are implemented by the ObjectDataSourceView and exposed directly by its ObjectDataSource control to page developers and other callers:

Filtering and Sorting Data

Data retrieval is more powerful when you can filter the data dynamically. Filtering is supported only by the ObjectDataSource control if the Select method returns a DataTable or DataSet object. You can use the FilterExpression and FilterParameters properties to apply dynamic filtering to data retrieval. These properties are implemented by the ObjectDataSourceView object and exposed directly by its ObjectDataSource control to data-bound controls and other callers.

You can sort the data that you retrieve with the ObjectDataSource by ordering the data in memory after it is retrieved. Sorting is supported only by the ObjectDataSource control if the Select method returns a DataTable or DataSet. The CanSort property always returns true, because the ObjectDataSourceView cannot determine what type is returned by the Select method without calling the method. The SortExpression property syntax is the same as for a DataView..::.Sort property.

Tracking View State

The ObjectDataSourceView implements the IStateManager interface and uses view state to track its state across page requests. Implementation of 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
ObjectDataSourceView, classe

Prend en charge le contrôle ObjectDataSource et fournit une interface pour les contrôles liés aux données pour exécuter des opérations avec des objets de données et des objets métier.

System..::.Object
  System.Web.UI..::.DataSourceView
    System.Web.UI.WebControls..::.ObjectDataSourceView

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

Le type ObjectDataSourceView expose les membres suivants.

  NomDescription
Méthode publiqueObjectDataSourceViewInitialise une nouvelle instance de la classe ObjectDataSourceView.
Début
  NomDescription
Propriété publiqueCanDeleteObtient une valeur indiquant si l'objet ObjectDataSourceView qui est associé au contrôle ObjectDataSource actuel prend en charge l'opération de suppression. (Substitue DataSourceView..::.CanDelete.)
Propriété publiqueCanInsertObtient une valeur indiquant si l'objet ObjectDataSourceView qui est associé au contrôle ObjectDataSource en cours prend en charge l'opération d'insertion. (Substitue DataSourceView..::.CanInsert.)
Propriété publiqueCanPageObtient une valeur indiquant si l'objet ObjectDataSourceView qui est associé au contrôle ObjectDataSource 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 ObjectDataSourceView qui est associé au contrôle ObjectDataSource 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 ObjectDataSourceView qui est associé au contrôle ObjectDataSource en cours prend en charge une vue triée sur la source de données sous-jacente. (Substitue DataSourceView..::.CanSort.)
Propriété publiqueCanUpdateObtient une valeur indiquant si l'objet ObjectDataSourceView qui est associé au contrôle ObjectDataSource en cours prend en charge l'opération de mise à jour. (Substitue DataSourceView..::.CanUpdate.)
Propriété publiqueConflictDetectionObtient ou définit une valeur qui détermine comment le contrôle ObjectDataSource exécute des mises à jour et des suppressions lorsque des données dans une ligne du stockage de données sous-jacent sont modifiées au cours de l'opération.
Propriété publiqueConvertNullToDBNullObtient ou définit une valeur indiquant si les valeurs Parameter qui sont passées à une opération de mise à jour, d'insertion ou de suppression passe automatiquement de la valeur nullNothingnullptrune référence null (Nothing en Visual Basic) à la valeur Value.
Propriété publiqueDataObjectTypeNameObtient ou définit le nom d'une classe utilisée par le contrôle ObjectDataSource d'un paramètre dans une opération de données. Le contrôle ObjectDataSource utilise la classe spécifiée au lieu des objets Parameter qui se trouvent dans les différentes collections de paramètres.
Propriété publiqueDeleteMethodObtient ou définit le nom de la méthode ou de la fonction que l'objet ObjectDataSourceView appelle pour supprimer des données.
Propriété publiqueDeleteParametersObtient la collection de paramètres qui contient les paramètres utilisés par la méthode DeleteMethod.
Propriété publiqueEnablePagingObtient ou définit une valeur indiquant si le contrôle de source de données prend en charge la pagination du groupe de données qu'il récupère.
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 de l'objet métier qui est identifiée par la propriété SelectMethod 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é publiqueInsertMethodObtient ou définit le nom de la méthode ou de la fonction que l'objet ObjectDataSourceView appelle pour insérer des données.
Propriété publiqueInsertParametersObtient la collection de paramètres qui contient les paramètres utilisés par la méthode InsertMethod.
Propriété protégéeIsTrackingViewStateObtient une valeur indiquant si l'objet ObjectDataSourceView enregistre les modifications apportées à son état d'affichage.
Propriété publiqueMaximumRowsParameterNameObtient ou définit le nom du paramètre de méthode de récupération de données qui est utilisé pour indiquer le nombre d'enregistrements à récupérer pour la prise en charge de la pagination de la source de données.
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 format à appliquer aux noms des paramètres des valeurs d'origine qui sont passées aux méthodes Delete ou Update.
Propriété publiqueSelectCountMethodObtient ou définit le nom de la méthode ou de la fonction que le contrôle ObjectDataSourceView appelle pour récupérer un nombre de lignes.
Propriété publiqueSelectMethodObtient ou définit le nom de la méthode ou de la fonction que le contrôle ObjectDataSourceView appelle pour récupérer des données.
Propriété publiqueSelectParametersObtient la collection de paramètres contenant les paramètres qui sont utilisés par la méthode SelectMethod.
Propriété publiqueSortParameterNameObtient ou définit le nom du paramètre de méthode de récupération de données qui est utilisé pour spécifier une prise en charge du tri de la source de données.
Propriété publiqueStartRowIndexParameterNameObtient ou définit le nom du paramètre de méthode de récupération de données utilisé pour indiquer l'index d'entiers du premier enregistrement à récupérer du jeu de résultats pour la prise en charge de la pagination de la source de données.
Propriété publiqueTypeNameObtient ou définit le nom de la classe que le contrôle ObjectDataSource représente.
Propriété publiqueUpdateMethodObtient ou définit le nom de la méthode ou de la fonction que l'objet ObjectDataSourceView appelle pour mettre à jour des données.
Propriété publiqueUpdateParametersObtient la collection de paramètres contenant les paramètres qui sont utilisés par la méthode UpdateMethod.
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 en appelant la méthode de l'objet métier qui est identifiée par la propriété DeleteMethod à l'aide des collections keys et 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 méthode DeleteMethod et des collections keys et oldValues spécifiées. (Substitue DataSourceView..::.ExecuteDelete(IDictionary, IDictionary).)
Méthode protégéeExecuteInsertExécute une opération d'insertion en appelant la méthode de l'objet métier qui est identifiée par la propriété InsertMethod à l'aide de la collection values spécifiée. (Substitue DataSourceView..::.ExecuteInsert(IDictionary).)
Méthode protégéeExecuteSelectRécupère des données de l'objet qui est identifié par la propriété TypeName en appelant la méthode qui est identifiée par la propriété SelectMethod et en passant toutes valeurs dans la collection SelectParameters. (Substitue DataSourceView..::.ExecuteSelect(DataSourceSelectArguments).)
Méthode protégéeExecuteUpdateExécute une opération de mise à jour en appelant la méthode qui est identifiée par la propriété UpdateMethod et à l'aide des paramètres fournis dans les collections keys, values ou oldValues. (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 en appelant la méthode de l'objet métier qui est identifiée par la propriété InsertMethod à l'aide de 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 l'objet ObjectDataSourceView a complété une opération de suppression.
Méthode protégéeOnDeletingDéclenche l'événement Deleting avant que l'objet ObjectDataSourceView ne tente une opération de suppression.
Méthode protégéeOnFilteringDéclenche l'événement Filtering avant que l'objet ObjectDataSourceView ne tente une opération de filtrage.
Méthode protégéeOnInsertedDéclenche l'événement Inserted après que l'objet ObjectDataSourceView a complété une opération d'insertion.
Méthode protégéeOnInsertingDéclenche l'événement Inserting avant que l'objet ObjectDataSourceView ne tente une opération d'insertion.
Méthode protégéeOnObjectCreatedDéclenche l'événement ObjectCreated après que ObjectDataSourceView a créé une instance de l'objet identifié par la propriété TypeName.
Méthode protégéeOnObjectCreatingDéclenche l'événement ObjectCreating avant que l'objet ObjectDataSourceView crée une instance d'un objet métier pour exécuter une opération de données.
Méthode protégéeOnObjectDisposingDéclenche l'événement ObjectDisposing avant que l'objet ObjectDataSourceView ignore un type instancié.
Méthode protégéeOnSelectedDéclenche l'événement Selected après que l'objet ObjectDataSourceView a complété une opération de récupération.
Méthode protégéeOnSelectingDéclenche l'événement Selecting avant que l'objet ObjectDataSourceView ne tente une opération de récupération.
Méthode protégéeOnUpdatedDéclenche l'événement Updated après que l'objet ObjectDataSourceView a complété une opération de mise à jour.
Méthode protégéeOnUpdatingDéclenche l'événement Updating avant que l'objet ObjectDataSourceView ne tente une opération de mise à jour.
Méthode protégéeRaiseUnsupportedCapabilityErrorAppelé par la méthode RaiseUnsupportedCapabilitiesError pour comparer les fonctions demandées pour une opération ExecuteSelect à celles prises en charge par l'affichage. (Hérité de DataSourceView.)
Méthode protégéeSaveViewStateEnregistre les modifications apportées à l'état d'affichage de l'objet ObjectDataSourceView depuis la publication de la page sur le serveur.
Méthode publiqueSelect(DataSourceSelectArguments)Récupère des données de l'objet qui est identifié par la propriété TypeName en appelant la méthode qui est identifiée par la propriété SelectMethod et en passant toutes valeurs dans 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 ObjectDataSourceView effectue le suivi des modifications de son état d'affichage afin qu'elles puissent être stockées dans l'objet ViewState du contrôle et être rendues persistantes entre les requêtes de la même page.
Méthode publiqueUpdate(IDictionary, IDictionary, IDictionary)Exécute une opération de mise à jour en appelant la méthode qui est identifiée par la propriété UpdateMethod et à l'aide des paramètres fournis dans les collections keys, values ou oldValues.
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 Delete est terminée.
Événement publicDeletingSe produit avant une opération Delete.
Événement publicFilteringSe produit avant une opération de filtre.
Événement publicInsertedSe produit lorsqu'une opération Insert est terminée.
Événement publicInsertingSe produit avant une opération Insert.
Événement publicObjectCreatedSe produit après que l'objet ObjectDataSourceView a créé une instance du type qui est identifié par la propriété TypeName.
Événement publicObjectCreatingSe produit avant que l'objet ObjectDataSourceView crée une instance du type qui est identifié par la propriété TypeName.
Événement publicObjectDisposingSe produit lorsque l'objet ObjectDataSourceView ignore une instance d'un objet qu'il a créé.
É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 Update est terminée.
Événement publicUpdatingSe produit avant une opération Update.
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.
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 obtenir une description de ce membre, consultez IStateManager..::.TrackViewState.
Début

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

La classe ObjectDataSourceView implémente les fonctionnalités de données pour le contrôle ObjectDataSource, y compris les opérations Select, Update, Delete et Insert, les paramètres de tri, de filtrage et de gestion conservés dans l'état d'affichage.

Un objet ObjectDataSourceView est créé pour chaque instance de la classe ObjectDataSource au moment de l'exécution. Les appels aux opérations de données de l'instance de la classe ObjectDataSource sont gérés par l'instance de l'objet ObjectDataSourceView. Les développeurs de pages n'accèdent pas à l'instance de la classe ObjectDataSourceView directement. Les développeurs de contrôles peuvent créer des contrôles de données personnalisés en étendant les classes ObjectDataSource et ObjectDataSourceView.

La classe ObjectDataSourceView exécute des opérations de données en appelant des méthodes sur des objets de données ou de métier à l'aide de la réflexion. Au moment de l'exécution, le contrôle ObjectDataSource crée une instance du type qui est identifié par la propriété TypeName, puis appelle la méthode appropriée à l'opération de données. L'objet instancié n'est pas mis en cache dans la mémoire par ObjectDataSourceView. L'objet est créé et a détruit pour chaque appel de méthode de données. Si la méthode est static (Shared en Visual Basic), une instance n'est pas créée, mais la méthode d'opération de données est toujours appelée.

ObjectDataSourceView n'est pas exposé directement aux développeurs de pages par le contrôle ObjectDataSource. À la place, les propriétés et les méthodes de ObjectDataSourceView sont accessibles via ObjectDataSource. Par exemple, le DeleteMethod de la propriété ObjectDataSourceView est défini en définissant la propriété DeleteMethod du ObjectDataSource.

Récupération de données

L'opération la plus fondamentale qu'une vue de source de données exécute est la récupération de données du stockage de données sous-jacentes à l'aide de la méthode Select qui récupère une collection IEnumerable d'éléments de données. Les méthodes, propriétés et événements de récupération des données suivants sont implémentés par l'objet ObjectDataSourceView et sont exposés directement par son contrôle ObjectDataSource aux développeurs de pages et aux autres appelants :

Mise à jour des données

L'objet ObjectDataSourceView prend en charge les mises à jour de données en appelant une méthode de l'objet métier ou de données qui est identifiée par la propriété UpdateMethod. Les contrôles liés aux données qui effectuent des mises à jour automatiquement, telles que les contrôles GridView et DetailsView, passent leurs paramètres dans une interface IOrderedDictionary au ObjectDataSourceView et l'objet de vue fusionne ces paramètres avec tous les paramètres qui sont localisés dans la collection UpdateParameters.

Les méthodes, propriétés et événements de mise à jour suivants sont implémentés par ObjectDataSourceView et sont exposés directement par son contrôle ObjectDataSource aux développeurs de pages et aux autres appelants :

Insertion de données

L'objet ObjectDataSourceView prend en charge les insertions de nouvelles lignes de données en appelant une méthode de l'objet métier ou de données qui est identifiée par la propriété InsertMethod. Les contrôles liés aux données qui effectuent des insertions automatiquement, telles que les GridView et DetailsView, passent leurs paramètres dans une interface IOrderedDictionary au ObjectDataSourceView et l'objet de vue fusionne ces paramètres avec tous les paramètres qui sont localisés dans la collection InsertParameters.

Les méthodes, propriétés et événements d'insertion suivants sont implémentés par ObjectDataSourceView et sont exposés directement par son contrôle ObjectDataSource aux développeurs de pages et aux autres appelants :

Suppression de données

L'objet ObjectDataSourceView prend en charge la suppression de données en appelant une méthode de l'objet métier ou de données qui est identifiée par la propriété DeleteMethod. Les contrôles liés aux données qui effectuent des suppressions automatiquement, telles que les GridView et DetailsView, passent leurs paramètres dans une interface IOrderedDictionary au ObjectDataSourceView et l'objet de vue fusionne ces paramètres avec tous les paramètres qui sont localisés dans la collection DeleteParameters. Les méthodes, propriétés et événements de suppression suivants sont implémentés par ObjectDataSourceView et sont exposés directement par son contrôle ObjectDataSource aux développeurs de pages et aux autres appelants :

Filtrage et tri des données

La récupération de données est plus puissante lorsque vous pouvez filtrer les données dynamiquement. Le filtrage est pris en charge uniquement par le contrôle ObjectDataSource si la méthode Select retourne un objet DataTable ou DataSet. 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 l'objet ObjectDataSourceView et sont exposées directement par son contrôle ObjectDataSource aux contrôles liés aux données et aux autres appelants.

Vous pouvez trier les données que vous récupérez avec ObjectDataSource en mettant les données en mémoire dans l'ordre après qu'elles ont été récupérées. Le tri est pris en charge uniquement par le contrôle ObjectDataSource si la méthode Select retourne un objet DataTable ou DataSet. La propriété CanSort retourne toujours true, car ObjectDataSourceView ne peut pas déterminer le type retourné par la méthode Select sans appeler la méthode. La syntaxe de la propriété SortExpression est la même que celle de la propriété DataView..::.Sort.

Suivi de l'état d'affichage

ObjectDataSourceView implémente l'interface IStateManager et utilise l'état d'affichage pour que son état soit suivi au fil des requêtes de page. L'implémentation des méthodes LoadViewState, SaveViewState et TrackViewState est fournie 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