System.Web.UI.DataSourceView.ExecuteUpdate Method

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

Syntax

protected virtual int ExecuteUpdate (IDictionary keys, IDictionary values, IDictionary oldValues)

Parameters

keys
An IDictionary of object or row keys to be updated by the update operation.
values
An IDictionary of name/value pairs that represent data elements and their new values.
oldValues
An IDictionary of name/value pairs that represent data elements and their original values.

Returns

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

Remarks

Data-bound controls can determine whether the DataSourceView.ExecuteUpdate(IDictionary, IDictionary, IDictionary) operation is supported by a data source control by using the DataSourceControl.GetView(string) method to retrieve the System.Web.UI.DataSourceView object and checking the value of the DataSourceView.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 System.Web.UI.WebControls.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.

Note:

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

Requirements

Namespace: System.Web.UI
Assembly: System.Web (in System.Web.dll)
Assembly Versions: 2.0.0.0
Since: .NET 2.0