SqlDataSourceView::UpdateParameters Property
Gets the parameters collection containing the parameters that are used by the UpdateCommand property.
Assembly: System.Web (in System.Web.dll)
[PersistenceModeAttribute(PersistenceMode::InnerProperty)] public: property ParameterCollection^ UpdateParameters { ParameterCollection^ get (); }
Property Value
Type: System.Web.UI.WebControls::ParameterCollectionA ParameterCollection that contains the parameters used by the UpdateCommand property.
If the UpdateCommand property contains a parameterized SQL query, the UpdateParameters collection contains any Parameter objects that correspond to the parameter placeholders that are in the SQL string.
Parameter names might be affected by the OldValuesParameterFormatString property; specifically, if the name identifies a primary key, such as a key that is specified using the DataKeyNames property, or in delete and update scenarios where the ConflictDetection property is set to the 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.
Depending on the ADO.NET provider, the order of the parameters in the UpdateParameters collection might be important. The System.Data.OleDb and System.Data.Odbc providers associate the parameters in the collection according to the order in which the parameters appear in the parameterized SQL query. The System.Data.SqlClient provider, which is the default ADO.NET provider for the 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 on parameterized SQL queries and commands, see Using Parameters with the SqlDataSource Control.
The following code example demonstrates how to use a SqlDataSource control to display data in a DropDownList control and update data when the Submit button is clicked. The UpdateCommand property is set with a parameterized SQL statement, and two ControlParameter parameters are added to the UpdateParameters collection. When the Submit button is clicked, the OnClick event is handled to call the Update method explicitly.
Windows 7, Windows Vista, Windows XP SP2, Windows XP Media Center Edition, Windows XP Professional x64 Edition, Windows XP Starter Edition, Windows Server 2008 R2, Windows Server 2008, Windows Server 2003, Windows Server 2000 SP4, Windows Millennium Edition, Windows 98
The .NET Framework and .NET Compact Framework do not support all versions of every platform. For a list of the supported versions, see .NET Framework System Requirements.