System.Web.UI.WebControls.SqlDataSource.Updating Event

Occurs before an update operation.

Syntax

public event SqlDataSourceCommandEventHandler Updating

Remarks

Handle the SqlDataSource.Updating event to perform additional initialization operations that are specific to your application, to validate the values of parameters, or to change the parameter values before the System.Web.UI.WebControls.SqlDataSource control performs the update operation. The connection to the underlying data source is not yet open when the event handler delegate is called. Therefore, you cannot directly cancel the SqlDataSource.Update database operation by calling the System.Data.Common.DbCommand.Cancel method on the System.Data.Common.DbCommand object that is exposed by the System.Web.UI.WebControls.SqlDataSourceCommandEventArgs object. You can, however, cancel the database operation by setting the System.ComponentModel.CancelEventArgs.Cancel property of the System.Web.UI.WebControls.SqlDataSourceCommandEventArgs to true.

For more information about handling events, see Consuming Events.

Note:

Values are inserted into parameters without validation, which is a potential security threat. Use the SqlDataSource.Updating event to validate parameter values before executing the query. For more information, see Script Exploits Overview.

Requirements

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