Assembly: System.Web (in System.Web.dll)
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 that 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 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 retrieve data from the Northwind database in Microsoft SQL Server by setting the SelectCommand property to an SQL query. The SQL query is parameterized and the placeholder in the SelectCommand property is matched to the ControlParameter object that is added to the collection. The DropDownList control, which the ControlParameter is bound to, acts as a filter for what is displayed in the ListBox control.
For information about other types of parameters you can use, see the Parameter class overview.
Available since 2.0