Page updating web

04 Dec

Upon completing the wizard, Visual Studio will add Bound Fields to the Details View for the " Delete Command= "DELETE FROM [Products] WHERE [Product ID] = @Product ID" Insert Command= "INSERT INTO [Products] ([Product Name], [Unit Price], [Discontinued]) VALUES (@Product Name, @Unit Price, @Discontinued)" Select Command= "SELECT [Product ID], [Product Name], [Unit Price], [Discontinued] FROM [Products]" Update Command= "UPDATE [Products] SET [Product Name] = @Product Name, [Unit Price] = @Unit Price, [Discontinued] = @Discontinued WHERE [Product ID] = @Product ID".

Visit the page in a browser and note the Edit, Delete, and New buttons included in the Details View.

As Figure 4 shows, when the page is visited through a browser a Delete button is included. Figure 4: Each Grid View Row Now Includes a Delete Button (Click to view full-size image) Upon clicking a Delete button, a postback occurs, the Grid View assigns the Figure 5 depicts this interaction graphically.

Alternatively, the Sql Data Source can be used in place of the Object Data Source.

These values can be: hard-coded directly in the In order for the data Web controls to utilize their built-in inserting, editing, and deleting capabilities, the data source control they are bound to must offer such functionality.

For the Sql Data Source, this means that properties.

To accomplish this we need to specify values for the Sql Data Source control s statement created in Step 2.

For now, let s use the Properties window in the Designer, although the Configure Data Source wizard or declarative syntax option would work just as well.