The Command object is used to give instructions to the database. Every data provider has its own command object that is inherited from the DbCommand object. The command object in the SQL data provider is SqlCommand, whereas the OLE DB provider has an OleDbCommand object. The command object is used to execute any kind of SQL statement, such as SELECT, UPDATE, INSERT, or DELETE. Command objects can also execute Stored Procedures. Later in the Working with stored procedures section, we will look at how to do that. They also have a few methods that are used to let the compiler know what type of command we are executing. For example, the ExecuteReader method queries in the database and returns a DataReader object:
using System.Data.SqlClient; ...