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

Is ADO.NET derived from COM? true /false

2 Answers   Infosys,


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

2 Answers  


What is full form of ado?

0 Answers  


How to create data relations?

0 Answers  


Explain the overview of ado.net architecture?

0 Answers  






what is the syntax code to oledb to connect oracle

6 Answers   IBM,


What is the significance of CommandBehavior.CloseConnection ?

0 Answers   NA,


What are the advantage of ado.net?

0 Answers  


What is the difference between Command and CommandBuilder object?

0 Answers  


Difference between datareader and dataset?

26 Answers   Microsoft, Noel Infotech, Satyam, Value Labs,


What does datareader object do?

0 Answers  


How to pass values into a datatable?

0 Answers  


Categories