ADO.NET Question: Download ADO.NET 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?

Tweet Share WhatsApp

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 PDF Read All 42 ADO.NET Questions
Previous QuestionNext Question
If we are not returning any records from the database, which method is to be used?Explain ExecuteNonQuery?