What are the Command Object Methods?

A)  ExecuteReader
B)  ExecuteScalar
C)  ExecuteNonQuery
D)  All of the Above.

Correct Answer :   All of the Above.


Explanation :

* ExecuteReader : This method works on select SQL query. It returns the DataReader object. Use DataReader read () method to retrieve the rows.
 
* ExecuteScalar : This method returns single value. Its return type is Object. If you call ExecuteScalar method with a SQL statement that returns rows of data, the query executes but returns only the first column of the first row returned by the query.
 
* ExecuteNonQuery : If you are using Insert, Update or Delete SQL statement then use this method. Its return type is Integer (The number of affected records).