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
Answer / m.mohan krishna
Sqlcommand.executescalar() is preffered.
Is This Answer Correct ? | 2 Yes | 0 No |
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 |
What is linq and entity framework?
If a table contains 20000 records. In a page at each time 100 records to be displayed.
What is the difference between Dataset. clone and Dataset.copy?
Which object needs to be closed?
What is data view and variable view?
what is clustered index?why is it created?
What is microsoft ado?
What is ado.net full form?
Which method is used by command class to execute SQL statements that return single value?
How to aggregating data across related tables?
What are major difference between classic ADO and ADO.NET?
what is Sql Native Client?