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
What is the use of sqldatareader class?
How to work with disconnected data - the dataset and sqldataadapter?
What is commandbuilder in ado.net?
How can I retrieve two tables of data at a time by using data reader? Data reader read and forward only, how is it possible to get 2 tables of data at a time?
What are the parameters that control most of connection pooling behaviours?
What are the major challenges in accessing data from a database?
What is the difference between sqldatareader and sqldataadapter?
Which is faster dataset or datareader?
I loaded the dataset with a table of 10 records. One of the records is deleted from the backend, how do you check whether all the 10 records were present while updating the data(which event and steps) and throw the exception 28 can datareader hold data from multiple tables?
How will you fill the gridview by using datatable object at runtime?
What are the differences between OLEDB and SQLClient Providers?
How is it possible to get 2 tables of data at a time by using data reader?
What is difference between executenonquery and executequery?
Why do we serialize data?
What is sqldatareader?