|
Answer» The following are the usages of the Command object in AD0.NET: The Command object in AD0.NET executes a command against the database and retrieves a DataReader or DataSet object.
- It ALSO executes the INSERT, UPDATE, or DELETE command against the database.
- All the command OBJECTS are derived from the DbCommand class.
- The command object is represented by two classes: SQLCOMMAND and OleDbCommand.
- The Command object provides three methods to execute COMMANDS on the database:
- The ExecuteNonQuery() method executes a Transact-SQL STATEMENT against the connection and returns the number of rows affected.
- The ExecuteScalar() method returns a single value from a database query.
- The ExecuteReader() method returns a result set by using the DataReader object.
The following are the usages of the Command object in AD0.NET: The Command object in AD0.NET executes a command against the database and retrieves a DataReader or DataSet object.
|