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

How do you implement locking concept for dataset?

0 Answers  


What are the core objects of ADO.NET?

0 Answers  


What is datatable in ado.net?

0 Answers  


How many commands does the oledbcommand takes?what are they?

2 Answers  


Explain what a diffgram is and its usage ?

2 Answers  






What is ado and rdo?

0 Answers  


How to find the given query is optimised one or not?

0 Answers  


What is ado.net object model?

0 Answers  


Explain how do you connect to sql server database without using sqlclient?

0 Answers  


About ADO and its objects ?

1 Answers   DELL,


can u tell me the how to get the print for the form

2 Answers   Crea,


What is fill method in ado.net?

0 Answers  


Categories