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



If i am expecting a single result from sqlserverdatabase then what command should i follow ?sqlcom..

Answer / pankul

sqlcommand.executescalar()

Is This Answer Correct ?    9 Yes 0 No

If i am expecting a single result from sqlserverdatabase then what command should i follow ?sqlcom..

Answer / m.mohan krishna

Sqlcommand.executescalar() is preffered.

Is This Answer Correct ?    2 Yes 0 No

If i am expecting a single result from sqlserverdatabase then what command should i follow ?sqlcom..

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

If i am expecting a single result from sqlserverdatabase then what command should i follow ?sqlcom..

Answer / raji

single result

Is This Answer Correct ?    0 Yes 5 No

Post New Answer

More ADO.NET Interview Questions

What is the difference between linq and ado.net?

0 Answers  


What is the difference between typed and untyped dataset?

0 Answers  


What is the purpose of using adodb?

0 Answers  


What is ole in vb?

0 Answers  


What is variable view?

0 Answers  


What are the ADO.NET Controls?

6 Answers  


What are the steps to connect to a database?

0 Answers  


what is Sql Native Client?

5 Answers   Gantec Solutions,


how to add a selected row of a gridview to another gridview without reloading the page??

2 Answers  


What are the Different layers in ADO.Net?

10 Answers   eXensys,


What are the uses of Stored Procedure?

0 Answers  


What are the advantages of using datalist?

0 Answers  


Categories