System.Web.UI.WebControls.SqlDataSource.UpdateParameters Property

Gets the parameters collection that contains the parameters that are used by the SqlDataSource.UpdateCommand property from the System.Web.UI.WebControls.SqlDataSourceView control that is associated with the System.Web.UI.WebControls.SqlDataSource control.

Syntax

[System.ComponentModel.DefaultValue(null)]
[System.ComponentModel.MergableProperty(false)]
[System.ComponentModel.Editor("System.Web.UI.Design.WebControls.ParameterCollectionEditor, System.Design, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a", "System.Drawing.Design.UITypeEditor, System.Drawing, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a")]
[System.Web.UI.PersistenceMode(System.Web.UI.PersistenceMode.InnerProperty)]
public ParameterCollection UpdateParameters { get; }

Value

Documentation for this section has not yet been entered.

Remarks

If the SqlDataSource.UpdateCommand property contains a parameterized SQL query, the SqlDataSource.UpdateParameters collection contains any System.Web.UI.WebControls.Parameter objects that correspond to the parameter placeholders in the SQL string.

Parameter names might be affected by the SqlDataSource.OldValuesParameterFormatString property, specifically if the name identifies a primary key, such as a key specified using the DataKeyNames property of the data-bound control, or in delete and update scenarios where the SqlDataSource.ConflictDetection property is set to the System.Web.UI.ConflictOptions.CompareAllValues value and a set of oldValues are passed to the corresponding data method. In this case, the format string is applied to each parameter name in the oldValues collection.

The order of the parameters in the SqlDataSource.UpdateParameters collection might be important, depending on the ADO.NET provider. The System.Data.OleDb and System.Data.Odbc providers associate the parameters in the collection according to the order that the parameters appear in the parameterized SQL query. The System.Data.SqlClient provider, which is the default ADO.NET provider for the System.Web.UI.WebControls.SqlDataSource control, associates the parameters in the collection by matching the name of the parameter with a placeholder alias in the SQL query. For more information about parameterized SQL queries and commands, see Using the SqlDataSource and AccessDataSource Controls with Parameters.

The SqlDataSource.UpdateParameters property retrieves the SqlDataSourceView.UpdateParameters property that is contained by the System.Web.UI.WebControls.SqlDataSourceView object that is associated with the System.Web.UI.WebControls.SqlDataSource control.

Note:

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.

Requirements

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