C# Tutorials and offshore development in India
    Tutorials   Resources   Forum   Reviews   Communities   Interview   Jobs   Projects   Training   Your Ad Here    
Silverlight Games | Mentor | Code Converter | Articles | Code Factory | Computer Jokes | Members | Peer Appraisal | IT Companies | Bookmarks | Polls | Revenue Sharing | Lobby | Gift Shop |


Prizes & Awards
My Profile



Active Members
TodayLast 7 Days more...






Forums » .NET » ASP.NET »

Sql


Posted Date: 19 Nov 2008      Posted By: g.krishna       Member Level: Silver     Points: 1   Responses: 2



Hi,


can we use datareader method with max or top finction





Responses

Author: Happy Coder    19 Nov 2008Member Level: GoldRating: 2 out of 52 out of 5     Points: 4

Offcourse you can use it, But i would suggest you to use ExecuteScalar for Max or Top as they are made for it,

Even if you use datareader, it doesnt make any difference, it exeuctes it as like another select query and returns are single record with single column. thats purly waste of resource.

happy Coder.

Geek is back.
____Happy_Coder____
If you feel this is helpful, RATE IT.



Author: Pavani    19 Nov 2008Member Level: GoldRating: 2 out of 52 out of 5     Points: 1

yes. But because it fecthes a single value, better to use executescalar.


Post Reply

 This thread is locked for new responses. Please post your comments and questions as a separate thread.
If required, refer to the URL of this page in your new post.


Next : WebParts
Previous : Asp.net
Return to Discussion Forum
Post New Message
Category: ASP.NET

Related Messages



dotNet Slackers

About Us    Contact Us    Privacy Policy    Terms Of Use