Updating Data Using a Command Object

Command objects can retrieve data, as you saw in the previous example. You can also use them to update, delete, and insert data—that is, you can use them to take action with the data. In this example, you'll add code that can update the prices of items in the Products table, using a Command object. After you add the required controls and code to the page, it should look like Figure 13.2.

Figure 13.2. Raising prices can be accomplished with just a few controls and a little code.

Follow these steps to modify the layout of Products.aspx and to add the code necessary to update prices:

1.
Immediately above the ...

Get ASP.NET Developer's JumpStart now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.