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

Answer Posted / 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



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

What are the differences between OLEDB and SQLClient Providers?

564


What is the difference between Command and CommandBuilder object?

591


What is bubbled event can you please explain?

527


What is execute reader in ado.net?

495


Which database is the ado.net?

498






Explain advantages of ado.net?

557


Do you use stored procedure in ado.net?

546


How many major types of connection objects in ADO.NET?

591


What is ado.net objects?

521


What is the advantage of ado.net?

545


Does ado.net use odbc?

525


Describe briefly an ADO.NET Dataset ?

551


Why edit is not possible in repeater?

522


Describe the disconnected architecture of ADO.NET’s data access model.

540


Why do we serialize data?

497