Command Object Methods - ADO.NET
Q. What are the Command Object Methods?- Published on 16 Jun 15
d. All of the above.
ANSWER: All of the above.
The common methods of command abject are as follows.
- 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).