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
Which is the best method to get two values from the database?
What is ado data control?
Which provider is used to connect ms access, oracle, etc…?
How is entity framework different from ado.net?
What is data adapter in ado.net with example?
What is the procedure to call a Stored Procedure of Back End in ADO (ActiveX Data Object) and RDO (Remote Data Objects)?
What is microsoft ado.net?
What are the 3 major types of connection objects in ado.net?
What is difference between datatable and dataset?
What is ado in agriculture?
How can you identify whether or not any changes are made to the DataSet object since it was last loaded?
What is the difference between Command and CommandBuilder object?
What are the uses of Stored Procedure?
How to add a check box or a dropdown list to a column in a datagrid?
Data reader read and forward only, how is it possible to get 2 tables of data at a time?