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,
|
| Author: shalini jennifer 10 May 2008 | Member Level: Gold | Rating: Points: 2 |
use more than one reader and more than one connection at a time
|