October 2010
Intermediate to advanced
1920 pages
73h 55m
English
Insert, Update, and Delete CommandsThe SqlDataSource control has methods that correspond to each of the different types of commands that it represents:
• Delete—
Enables you to execute a SQL delete command.
• Insert—
Enables you to execute a SQL insert command.
• Select—
Enables you to execute a SQL select command.
• Update—
Enables you to execute a SQL update command.
For example, the page in Listing 9.27 contains a form for adding new entries to the GuestBook database table. This form is not contained in a DataBound control such as the FormView or DetailsView controls. The form is contained in the body of the page. When you click the Add Entry button, the SqlDataSource control’s Insert() method is executed.
Listing 9.27. ExecuteInsert.aspx ...