October 2010
Intermediate to advanced
1920 pages
73h 55m
English
Under the covers, the SqlDataSource control uses ADO.NET objects such as the ADO.NET DataSet, DataReader, Parameter, and Command objects to interact with a database. In particular, any ASP.NET Parameter objects that you declare when working with the SqlDataSource control get converted into ADO.NET Parameter objects.
In some cases, you want to work directly with these ADO.NET Parameter objects when using the SqlDataSource control. For example, you might want to add additional ADO.NET parameters programmatically before executing a command.
The page in Listing 9.26 automatically adds an ADO.NET Parameter that represents the current user’s username to the command that the SqlDataSource executes.
Listing 9.26. AddParameter.aspx ...