ADO.NET Question:
Download Questions PDF

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?

Answer:

yes this is possible

If we execute 2 select command either in stored procedure or in select command and then executereader method fired of command object. it return 2 tables in datareader.

like :
string str="Select * from a;select * from b";
cmd.commandtext=str;
dr=cmd.executereader();

Now it return 2 tables in datareader (dr).

Download ADO.NET Interview Questions And Answers PDF

Previous QuestionNext Question
If we are not returning any records from the database, which method is to be used?Explain ExecuteNonQuery?