Clicking the Edit button turns the Details View into edit mode, which displays each Bound Field whose (the default) as a Text Box, and the Check Box Field as a checkbox.
Figure 9: The Details View s Default Editing Interface (Click to view full-size image) Similarly, you can delete the currently selected product or add a new product to the system.
As we'll see in this tutorial, these statements can be created manually or can be automatically generated by the Sql Data Source s Configure Data Source wizard.
Note Since we ve already discussed the inserting, editing, and deleting capabilities of the Grid View, Details View, and Form View controls, this tutorial will focus on configuring the Sql Data Source control to support these operations.
In previous tutorials we learned how the Object Data Source control allowed for inserting, updating, and deleting of data.
The Sql Data Source control supports the same operations, but the approach is different, and this tutorial shows how to configure the Sql Data Source to insert, update, and delete data.
Refer back to the Examining the Events Associated with Inserting, Updating, and Deleting tutorial for a more detailed discussion on the chain of events associated with inserting, updating, and deleting from a data Web control.Fortunately, the Configure Data Source wizard provides an option to have the statements checkbox will only be checkable if the table selected has a primary key and the primary key column (or columns) are included in the list of returned columns.The Use optimistic concurrency checkbox, which becomes selectable once the Generate statements to provide optimistic concurrency control.Recall that to support inserting, updating, and deleting, with the Object Data Source we needed to specify the object layer methods to invoke to perform the insert, update, or delete action.With the Sql Data Source, we need to provide SQL statements (or stored procedures) to execute.Since the Note The Details View s inserting and editing interfaces lack any sort of customization or validation.To add validation controls or to customize the interfaces, you need to convert the Bound Fields to Template Fields.If you need to brush up on implementing these features within the Grid View, Details View, and Form View, return to the Editing, Inserting, and Deleting Data tutorials, starting with An Overview of Inserting, Updating, and Deleting.collection and can include hard-coded values, common parameter source values (querystring fields, session variables, Web control values, and so on), or can be programmatically assigned.An Overview of Inserting, Updating, and Deleting examined using the Object Data Source to facilitate inserting, updating, and deleting with the Grid View, Details View, and Form View controls.Alternatively, the Sql Data Source can be used in place of the Object Data Source.