Golgappa.net | Golgappa.org | BagIndia.net | BodyIndia.Com | CabIndia.net | CarsBikes.net | CarsBikes.org | CashIndia.net | ConsumerIndia.net | CookingIndia.net | DataIndia.net | DealIndia.net | EmailIndia.net | FirstTablet.com | FirstTourist.com | ForsaleIndia.net | IndiaBody.Com | IndiaCab.net | IndiaCash.net | IndiaModel.net | KidForum.net | OfficeIndia.net | PaysIndia.com | RestaurantIndia.net | RestaurantsIndia.net | SaleForum.net | SellForum.net | SoldIndia.com | StarIndia.net | TomatoCab.com | TomatoCabs.com | TownIndia.com
Interested to Buy Any Domain ? << Click Here >> for more details...


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 does connection string consists of ?

4 Answers   Digital GlobalSoft,


can we have multiple datatables in a datareader ?

18 Answers   Fulcrum Logic, Infosys, Kale Consultants, Ness Technologies,


How do we use stored procedure in ADO.NET and how do we provide parameters to the stored procedures?

0 Answers   SwanSoft Technologies,


What is disconnected data?

0 Answers  


Using Ado.net, what front ends and back ends can you use?

10 Answers  


What are the different row versions available?

3 Answers  


How do you update a dataset in ado.net and how do you update database through dataset?

0 Answers  


Why DataReader is Forward Only?

16 Answers   IBM, NIIT,


What is the maximum pool size in ado.net connection string?

0 Answers  


How many types of data table are in SQL.NET

4 Answers   Chetu India, HCL, MAHINDRA,


What is the current version of entity framework?

0 Answers  


how Sequence to connect and retrieve data from database using dataset?

0 Answers  


Categories