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


May 05, 2008 02:55:20 #6
 amplemaddy   Member Since: May 2008    Total Comments: 7 

RE: retrieve two tables of data at a time by using data reader
 
objCmd.CommandText = "SELECT * FROM table1,table2";
objRdr = objCmd.ExecuteReader();

you can try to sql join in a single query like this
     

 

Back To Question