If i am expecting a single result from sqlserverdatabase
then what command should i follow ?sqlcommand.executereader
(commandbehaviour.singleresult)or sqlcommand.executescalar()

Answers were Sorted based on User's Feedback



If i am expecting a single result from sqlserverdatabase then what command should i follow ?sqlcom..

Answer / pankul

sqlcommand.executescalar()

Is This Answer Correct ?    9 Yes 0 No

If i am expecting a single result from sqlserverdatabase then what command should i follow ?sqlcom..

Answer / m.mohan krishna

Sqlcommand.executescalar() is preffered.

Is This Answer Correct ?    2 Yes 0 No

If i am expecting a single result from sqlserverdatabase then what command should i follow ?sqlcom..

Answer / vinay

Both of these are same commandbehaviour.singleresult also
give you a single result. but we should use
sqlcommand.executescalar()

Is This Answer Correct ?    1 Yes 0 No

If i am expecting a single result from sqlserverdatabase then what command should i follow ?sqlcom..

Answer / raji

single result

Is This Answer Correct ?    0 Yes 5 No

Post New Answer

More ADO.NET Interview Questions

What is linq and entity framework?

0 Answers  


If a table contains 20000 records. In a page at each time 100 records to be displayed.

0 Answers  


What is the difference between Dataset. clone and Dataset.copy?

0 Answers  


Which object needs to be closed?

0 Answers  


What is data view and variable view?

0 Answers  






what is clustered index?why is it created?

4 Answers   Microsoft, Wipro,


What is microsoft ado?

0 Answers  


What is ado.net full form?

0 Answers  


Which method is used by command class to execute SQL statements that return single value?

0 Answers  


How to aggregating data across related tables?

0 Answers  


What are major difference between classic ADO and ADO.NET?

2 Answers  


what is Sql Native Client?

5 Answers   Gantec Solutions,


Categories