O'Reilly logo

ASP.NET Developer's JumpStart by Ken Getz, Paul D. Sheriff

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

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 ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required