Golgappa.net | Golgappa.org | BagIndia.net | BodyIndia.Com | CabIndia.net | CarsBikes.net | CarsBikes.org | CashIndia.net | ConsumerIndia.net | CookingIndia.net | DataIndia.net | DealIndia.net | EmailIndia.net | FirstTablet.com | FirstTourist.com | ForsaleIndia.net | IndiaBody.Com | IndiaCab.net | IndiaCash.net | IndiaModel.net | KidForum.net | OfficeIndia.net | PaysIndia.com | RestaurantIndia.net | RestaurantsIndia.net | SaleForum.net | SellForum.net | SoldIndia.com | StarIndia.net | TomatoCab.com | TomatoCabs.com | TownIndia.com
Interested to Buy Any Domain ? << Click Here >> for more details...

can we have multiple datatables in a datareader ?

Answer Posted / vrsanaidu

Yes, we can have multiple result set means multiple
datatable data in one datareader..., code as below

SqlConnection con = new
SqlConnection(ConfigurationSettings.AppSettings["con"]);
SqlCommand cmd = new SqlCommand("SELECT SiteName FROM
Sites;SELECT SiteCode FROM Sites", con);
cmd.Connection.Open();
SqlDataReader r = cmd.ExecuteReader();
do {
while(r.Read()) {
Response.Write(r.GetString(0) + "<br>");
}
} while (r.NextResult());


r.Close();
con.Close();
cmd = null;
r = null;
con = null;

Is This Answer Correct ?    47 Yes 1 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

What are the ado.net connection pooling parameters?

972


Explain what are acid properties?

978


What is ado circle?

1127


How can you add or remove rows from the datatable object of dataset?

1019


What are the different execute methods of Ado.Net?

1020


What is the use of connection object in ado.net?

1049


What is method to get XML and schema from Dataset? getXML() and get Schema ()

966


how to create a quiz software using 4 options to answer and how to check with answers in the database and award marks....

4444


Explain the difference between data reader and data adapter?

965


List the 4 common ado.net namespaces?

1160


What are two important objects of ADO.Net?

1013


What is the purpose of using adodb?

955


If a table contains 20000 records. In a page at each time 100 records to be displayed.

886


What is two way data binding android?

984


Explain why edit is not possible in repeater?

1030