Executing Inline SQL Statements

You can use the SqlDataSource control to represent four different types of SQL commands. The control supports the following four properties:

SelectCommand

InsertCommand

UpdateCommand

DeleteCommand

You can assign any SQL statement to any of these properties. For example, the page in Listing 9.7 uses all four properties to enable selecting, inserting, updating, and deleting records from the Movies database table (see Figure 9.3).

Figure 9.3. Executing inline SQL commands.

image

Listing 9.7. ShowInlineCommands.aspx

The page in Listing 9.7 contains a DetailsView control bound to a SqlDataSource control. You can ...

Get ASP.NET 4 Unleashed 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.