Which is the best method to get the single value from Database?

 Posted by Lakhangarg on 8/25/2009 | Category: Sql Server Interview questions | Views: 20605
Select from following answers:
  1. ExecuteDataSet()
  2. ExecuteScalar()
  3. ExecuteReader()
  4. ExecuteNonQuery() With Output parameters
  5. All Above

Show Correct Answer

Asked In: Many Interviews | Alert Moderator 

Comments or Responses

Posted by: Raja on: 8/25/2009
Either the question or the answer is wrong.

The question is "Which is the best method to get the single record from Database?"

ExecuteScalar() method of ADO.NET Command eg. SqlCommand object is used to get the first row and first column data from the SELECT statement.

It doesn't give the single record, but it gives the single value.

Please correct the question.


Login to post response