Assembly: System.Web (in System.Web.dll)
Make sure that no BoundField controls in the data-bound control that you bind to the SqlDataSource control have names that match any parameter names in the collection. Parameters that have the same name as bound fields are excluded from the SQL command, and a "parameter was not supplied" error might result.
If the ConflictDetection property is set to the CompareAllValues value, the parameters are created for both the old and new values of the data. The parameters for the old values are named according to the OldValuesParameterFormatString property.
Depending on the ADO.NET provider, the order of the parameters in 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 the placeholder in the SQL query. For more information about parameterized SQL queries and commands, see Using Parameters with the SqlDataSource Control.collection might be important. The
The following code example demonstrates how to set the DeleteCommand text to delete an order from the Northwind database. Initially, data is retrieved from the Orders table and displayed in a DropDownList control. You must explicitly declare property and call the Delete method when using data-bound controls, such as DropDownList (unlike other controls, such as GridView and DetailsView, which automatically populate the parameters and call Delete on a data source control). In this example, the OnClick event is delegated to the private OnDelete event handler, which explicitly calls the Delete method of the SqlDataSource control.
Available since 2.0