Q:
What are the usages of the Command object in ADO.NET?
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 the commands and does not return any value.
=> The ExecuteScalar() method returns a single value from a database query.
=> The ExecuteReader() method returns a result set by using the DataReader object.
View answer
Workspace
Report Error
Discuss