Chapter 8: Executing Database Commands

Overview

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




Mastering C# Database Programming
Mastering the SAP Business Information Warehouse: Leveraging the Business Intelligence Capabilities of SAP NetWeaver
ISBN: 0764596373
EAN: 2147483647
Year: 2003
Pages: 181

flylib.com © 2008-2017.
If you may any questions please contact us: flylib@qtcs.net