If you are using two select queries and retrieving data. how
do you access second query's result set using data reader?

Answer Posted / uday kumar vuriti

If we have 2 select queries as follws
select * from dept
select * from emp

SqlDataReader dr;

//To Read 1st Select query dept
dr.Read();

//To Read 2nd Select query emp
dr.NextResult();

So the answer is dr.NextResult();

Is This Answer Correct ?    27 Yes 0 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

Explain what is an abstract class?

562


Define application state variable and session state variable?

558


How can u deifne the benefits and limitation of using Viewstate for state management?

714


Apart from IDE what are the enhancements in asp.net 2.0?

1629


What's the difference between viewstate and sessionstate?

573






Explain what is the procedure to create the environment for asp.net? : asp.net mvc

541


What are resource file and how do we generate resource file?

570


What language is asp.net written in?

529


How do I open an ashx file in windows 7?

575


When does a session actually start?

575


What is the use of view state?

536


Briefly describe the role of global.asax?

580


Which adapter should you use, if you want to get the data from an access database?

544


What is the significance of finalize method in .net?

554


Define msil.

552