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
How do you connect to sql server database without using sqlclient?
What is command class in ado.net?
How to connect and retrieve data from database using dataset
What are the different methods by which we can populate a dataset?
Command objects uses, purposes and their methods.
What does executereader return?
What are the advantages of oledb compared with other classes?
What are the 3 major types of connection objects in ado.net?
how can implement dropdownlist in particular of dataset when try to update?
What is acid in ado.net?
oledbdataadpter with ms access in c#.net giving exception System.Data.OleDb.OleDbException while writing adapter.update(dataset,"tabname"); how to update the database from dataset?
Define different execute methods of ADO.NET command object ?
What is bubbled event can you please explain?
What is the difference between Data adaptor and Data set?
What is the difference between a datareader and a dataset?