October 2010
Intermediate to advanced
1920 pages
73h 55m
English
Command ObjectThe Command object represents a command that can be executed against a data source. In this section, you learn how to use the SqlCommand object to execute different types of database commands against Microsoft SQL Server.
You can use the SqlCommand.ExecuteNonQuery() method to execute a SQL command that does not return a set of rows. You can use this method when executing SQL UPDATE, DELETE, and INSERT commands. You can also use this method when executing more specialized commands, such as a CREATE TABLE or DROP DATABASE command.
For example, the component in Listing 19.7 includes Update() and Delete() methods that update and delete movie records.
Listing 19.7. App_Code\Movie3.cs
The page in ...