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 is meant by executenonquery?

895


Why do we need ado.net?

917


Explain how do you connect to sql server database without using sqlclient?

946


What does ado stand for in ado.net?

1016


Does entity framework use ado.net?

936


Explain what are acid properties?

929


What connected data?

896


How to read data with the sqldatareader ?

928


Is entity framework better than ado.net?

942


Can datareader hold data from multiple tables?

1126


Can we create Synonymns in MS Acess,My Sql Server,Sql Server? But iam we can create in oracle!

2097


What are the advantages of using datalist?

970


How does entity framework work?

859


What is the full form of ado?

944


How to create dynamic gridview?

989