GeekInterview.com
   Home |  Tech FAQ  |   Interview Questions |  Placement Papers |  Tech Articles |  Learn |  Freelance Projects |  Online Testing |  Geeks Talk |  Job Postings |  Knowledge Base | Site Search |  Add/Ask Question

  GeekInterview.com  >  Interview Questions  >  Microsoft  >  Ado.NET

 Print  |  
Question:  retrieve two tables of data at a time by using data reader

Answer: One interview I faced a Q:
how can i retrieve two tables of data at a time by using data reader?
Data reader read and forward only, how is it possible to get 2 tables of data at a time


December 12, 2007 23:53:15 #5
 ASWINRAMESH   Member Since: December 2007    Total Comments: 1 

RE: retrieve two tables of data at a time by using data reader
 

A situation where we want to pass 2 or more querries to a
DataReader like "Select * from Table1;Select * from Table2"


we have do the following things

while(datareader.nextResultSet())
{
 while(datareader.read())
  {
    .......Processing of result set..
  }
}

 
     

 

Back To Question