Performs an update operation using the SqlDataSource.UpdateCommand SQL string and any parameters that are in the SqlDataSource.UpdateParameters collection.
A value that represents the number of rows updated in the underlying database.
The SqlDataSource.Update method is automatically called by the System.Web.UI.WebControls.GridView, System.Web.UI.WebControls.DetailsView, and System.Web.UI.WebControls.FormView controls during postback if the data has been changed. For data that has been changed in other controls, the SqlDataSource.Update method can be explicitly called on postback during the System.Windows.Forms.Form.Load event.
Before the SqlDataSource.Update operation is performed, the SqlDataSourceView.OnUpdating(SqlDataSourceCommandEventArgs) method is called to raise the SqlDataSource.Updating event. You can handle this event to examine the values of the parameters and to perform any preprocessing before an SqlDataSource.Update operation.
After the SqlDataSource.Update operation completes, the SqlDataSourceView.OnUpdated(SqlDataSourceStatusEventArgs) method is called to raise the SqlDataSource.Updated event. You can handle this event to examine any return values and error codes and to perform any post-processing.
The SqlDataSource.Update method delegates to the erload:System.Web.UI.WebControls.SqlDataSourceView.Update method of the System.Web.UI.WebControls.SqlDataSourceView object that is associated with the System.Web.UI.WebControls.SqlDataSource control. To perform an update operation, the System.Web.UI.WebControls.SqlDataSourceView builds a System.Data.Common.DbCommand object using the SqlDataSource.UpdateCommand text and any associated SqlDataSource.UpdateParameters properties, and then executes the System.Data.Common.DbCommand object against the underlying database.
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.