C# Tutorials and offshore development in India
    Tutorials   Resources   Forum   Communities   Interview   Jobs   Projects   Offshore Development    
Silverlight Tutorials | Mentor | Code Converter | Articles | Code Factory | Computer Jokes | Members | Peer Appraisal | IT Companies | Bookmarks | Revenue Sharing |


Prizes & Awards
My Profile



Active Members
TodayLast 7 Days more...

New Feature: Community Sites: Create your own .NET community website and start earning from Google AdSense ! It's Free !




SqlDataReader


Posted Date: 09 May 2008      Total Responses: 1

Posted By: urpalshu       Member Level: Gold     Points: 1


Hello:

1.As I have read that using a SQLDataReader is the best to use if you have not Inserts or Updates to be made. Is this true?

2. I have a situation where I would have two sql statements to execute and would want to use SqlDataReader.

3. I want these two result sets from sqlDataReader to be stored seperately probably in two DataTables.

4. Please could somebody tell me the most efficient way to accomplish these two resultsets.

5. Where the Connection pool is utilized efficiently, and closed.


Please help and correct by code below,

SqlCommand myCommand1 = new SqlCommand(sql1, conn);
SqlCommand myCommand2 = new SqlCommand(sql2, conn);
SqlDataReader dr1 = myCommand.ExecuteReader();
SqlDataReader dr2 = myCommand.ExecuteReader();

SqlDataReader dr1 = myCommand.ExecuteReader();
SqlDataReader dr2 = myCommand.ExecuteReader();

Thank you,




Responses

Author: shalini jennifer    10 May 2008Member Level: GoldRating:     Points: 2
use more than one reader and more than one connection at a time


Post Reply
You must Sign In to post a response.
Next : div
Previous : Code Efficiency
Return to Discussion Forum
Post New Message
Category: .NET

Related Messages



dotNet Slackers   BizTalk Adaptors    Web Design

online optimum rewards

Contact Us    Privacy Policy    Terms Of Use