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 difference between sqldatareader and sqldataadapter?
What is the difference between Response.Expires and Reponse.ExpiresAbsolute?
Explain the dataadapter class in ado.net?
suppose we using gridview contrl,with sqldatasource.in that for birth date how can we take validation contrl for dd/mm/yy formator how we assign regular expression for same
What is defaultview in datatable?
what are the differences between dataset and datareader?
What is an orm, and why would you use one instead of plain old ado.net?
How can I retrieve two tables of data at a time by using data reader?
What is dbcontext and dbset in entity framework?
How to identify the updated rows in a dataset?
what is trigger?
8 Answers Microsoft, Precept Technology,
Where do you store connection string ?