Best Method to retrieve two values from Database (SQL Server)

 Posted by Lakhangarg on 8/18/2009 | Category: ADO.NET Interview questions | Views: 24832
Select from following answers:
  1. ExecuteDataSet()
  2. ExecuteScalar()
  3. ExecuteReader()
  4. ExecuteNonQuery()
  5. All Above

Show Correct Answer

Asked In: Many Interviews | Alert Moderator 

Comments or Responses

Posted by: Ganesh1984 on: 4/23/2011 | Points: 10
i have small doubt.plz clarify me.actually ExecuteNonQuery() does not return any value from the database .it is execute command only means insert, delete,update .so how to retrieve two values from database.
Posted by: Lakhangarg on: 4/25/2011 | Points: 10
Using OUTPUT Parameters.
Posted by: AbuHamdaan on: 9/9/2011 | Points: 10
Hi there..
Just a question, cant we make use Of ExecuteReader() instead.. i think must be much feasible solution !!!!

Posted by: Kannanthangamuthu on: 12/26/2011 | Points: 10
Why cant you try OracleDateReader or SqlDataReader...
Through this you can fetch any number of values in a single row!

Posted by: Santoshpatna123 on: 11/22/2012 | Points: 10
ExecuteReader() Is Correct answer, Because ExecuteNonQuery() return only one value at a time. When we execute comman.

Login to post response

More Interview Questions by Lakhangarg