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 is the difference betwen typed dataset and untyped dataset?in general which dataset can we use in programming?

743


Explain the advantage of ADO.Net?

735


What is the difference between Response.Expires and Reponse.ExpiresAbsolute?

776


List the 4 common ado.net namespaces?

867


What are the rules to implement connection pooling?

730


What are the parameters that control most of connection pooling behaviours?

804


What do you mean by performing asynchronous operation using command object?

737


What are the benefits of using of ADO.NET in .NET 4.0?

733


Define isolation?

732


What are the classes in System.Data.Common Namespace?

886


What are the advantages and drawbacks of using ado.net?

858


Define the executescalar method?

672


Which object is used to add relationship between two Datatables?

774


Define connection string?

783


What is the difference between data grid and data repeater?

741