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

Answer Posted / m.mohan krishna

Sqlcommand.executescalar() is preffered.

Is This Answer Correct ?    2 Yes 0 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

Can datareader hold data from multiple tables?

677


What are the different layers of ado.net?

518


how we can fire event in databound coulm in datagfrid withot using button?

574


What does executenonquery () method return?

499


How to pass values into a datatable?

597






What is ado and dao?

530


What is connection in ado.net?

532


What are the objects of ado.net?

529


how to create a quiz software using 4 options to answer and how to check with answers in the database and award marks....

3716


What is ole2 format?

502


What is an example of ordinal data?

487


How can you identify whether or not any changes are made to the DataSet object since it was last loaded?

554


What are good ado.net object to replace to ado recordset object.

570


What are the difference between readonly vs. Const?

504


Explain the dataadapter class in ado.net?

663