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


November 11, 2008 21:48:33 #10
 rekha969   Member Since: November 2008    Total Comments: 1 

RE: retrieve two tables of data at a time by using data reader
 
Better use joins like
Select field1, field2, field3 from table1 inner join table2 on table1.fieldx = table2.fieldx
field1, filed2 are from first table
field3 from second table
fieldx is common field from both table.
     

 

Back To Question