|
|
Database commands are executed through Command objects, and are part of the managed providers. There are three Command classes: SqlCommand, OleDbCommand, and OdbcCommand. You use a Command object to execute a SQL SELECT, INSERT, UPDATE, or DELETE statement. You can also use a Command object to call a stored procedure, or retrieve all the rows and columns from a specific table; this is known as a TableDirect command. A Command object communicates with the database using a Connection object, which was described in Chapter 7, "Connecting to a Database."
Featured in this chapter:
The SqlCommand class
Using a SqlCommand object to execute commands against a SQL Server Database
Executing SELECT statements and TableDirect commands
Executing a command that retrieves data as XML
Executing commands that modify information in the database
Introducing transactions
Supplying parameters to commands
Executing SQL Server stored procedures
Creating a Command object using Visual Studio .NET
|
|