Performs an insert operation using the SqlDataSource.InsertCommand SQL string and any parameters that are in the SqlDataSource.InsertParameters collection.
A value that represents the number of rows inserted into the underlying database.
Before the insert operation is performed, the SqlDataSourceView.OnInserting(SqlDataSourceCommandEventArgs) method is called to raise the SqlDataSource.Inserting event. You can handle this event to examine the values of the parameters and to perform any preprocessing before the SqlDataSource.Insert operation. To perform an insert operation, the System.Web.UI.WebControls.SqlDataSourceView object builds an System.Data.Common.DbCommand object using the SqlDataSource.InsertCommand text and any associated SqlDataSource.InsertParameters properties, and then executes the System.Data.Common.DbCommand object against the underlying database.
After the operation completes, the SqlDataSourceView.OnInserted(SqlDataSourceStatusEventArgs) method is called to raise the SqlDataSource.Inserted event. You can handle this event to examine any return values and error codes and to perform any post-processing.
The SqlDataSource.Insert method is provided for programmatic access to the Insert method. If the System.Web.UI.WebControls.SqlDataSource control is associated with a data-bound control, the data-bound control automatically calls the Insert method.
The SqlDataSource.Insert method delegates to the SqlDataSourceView.Insert(IDictionary) method of the System.Web.UI.WebControls.SqlDataSourceView object that is associated with the System.Web.UI.WebControls.SqlDataSource control.
Values are inserted into parameters without validation, which is a potential security threat. Use the SqlDataSource.Filtering event to validate parameter values before executing the query. For more information, see Script Exploits Overview.