Start Sqldatasource updating

Sqldatasource updating

Select the Delete Query property, which will bring up a set of ellipses.

You can control the order of parameters by explicitly specifying them in the collection for the related data operation, such as the .

When you explicitly create a parameter collection for parameters that are automatically created from values passed by a data-bound control, the explicitly created parameters overwrite any parameters that are automatically generated.

Once we add deleting support to the Grid View, the Grid View will automatically supply this parameter value, using the value of its property added, the Grid View s smart tag now contains the Enable Deleting option. As discussed in An Overview of Inserting, Updating, and Deleting, this causes the Grid View to add a Command Field with its .

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.

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.

When the Sql Data Source control s method is invoked either programmatically or automatically from a data Web control a connection to the database is established, the parameter values are assigned to the query, and the command is shuttled off to the database.

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.

From the Designer in Sql Data Source and then bring up the Properties window (from the View menu, choose Properties window, or simply hit F4).

control, you can specify SQL queries and statements that use parameters.

This helps make your data-binding scenarios more flexible by reading and writing database information based on values that are evaluated at run time.

If you choose to participate, the online survey will be presented to you when you leave the Msdn Web site.