DataSourceView.ExecuteUpdate Method

Performs an update operation on the list of data that the DataSourceView object represents.

Namespace: System.Web.UI
Assembly: System.Web (in system.web.dll)

Protected Overridable Function ExecuteUpdate ( _
	keys As IDictionary, _
	values As IDictionary, _
	oldValues As IDictionary _
) As Integer
Dim keys As IDictionary
Dim values As IDictionary
Dim oldValues As IDictionary
Dim returnValue As Integer

returnValue = Me.ExecuteUpdate(keys, values, oldValues)
protected int ExecuteUpdate (
	IDictionary keys, 
	IDictionary values, 
	IDictionary oldValues
protected function ExecuteUpdate (
	keys : IDictionary, 
	values : IDictionary, 
	oldValues : IDictionary
) : int
Not applicable.



An IDictionary of object or row keys to be updated by the update operation.


An IDictionary of name/value pairs that represent data elements and their new values.


An IDictionary of name/value pairs that represent data elements and their original values.

Return Value

The number of items that were updated in the underlying data storage.

Exception typeCondition


The ExecuteUpdate operation is not supported by the DataSourceView.

Data-bound controls can determine whether the ExecuteUpdate operation is supported by a data source control by using the DataSourceControl.GetView method to retrieve the DataSourceView object and checking the value of the CanUpdate property.

The keys parameter represents the object or row keys of the data to update. For data sources that represent relational data, such as the SqlDataSource control, the keys parameter is a collection of database primary keys. In other scenarios, the keys parameter is a collection of name/value pairs and is used to filter a list of data. Any data matching a name/value pair is updated with the values found in the values parameter, which is a set of name/value pairs that represents new values for existing fields or columns.


The DataSourceView class's default implementation is to throw a NotSupportedException exception. If you extend the DataSourceView class, override the ExecuteUpdate method if your class supports updating data in the underlying data storage.

The following code example demonstrates how a class that extends the DataSourceView class can override the CanUpdate property and the ExecuteUpdate method. This code example is part of a larger example provided for the DataSourceView class.

   ' The CsvDataSourceView does not currently
   ' permit update operations. You can modify or
   ' extend this sample to do so.
   Public Overrides ReadOnly Property CanUpdate() As Boolean
         Return False
      End Get
   End Property

   Protected Overrides Function ExecuteUpdate(keys As IDictionary, _
                                              values As IDictionary, _
                                              oldValues As IDictionary) As Integer
      Throw New NotSupportedException()
   End Function 'ExecuteUpdate

End Class 'CsvDataSourceView

Windows 98, Windows Server 2000 SP4, Windows Server 2003, Windows XP Media Center Edition, Windows XP Professional x64 Edition, Windows XP SP2, Windows XP Starter Edition

The Microsoft .NET Framework 3.0 is supported on Windows Vista, Microsoft Windows XP SP2, and Windows Server 2003 SP1.

.NET Framework

Supported in: 3.0, 2.0