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 difference between datagridview and datagrid control in winforms?

957


What is aggregating data ?

912


What is the meaning of executenonquery?

963


What are the ado.net components?

969


What is meant by executenonquery?

890


How to bind the controls(best practice) comboboxes to the data in the dataset?

1006


What are the various methods provided by the DataSet object to generate XML?

969


What is maximum pool size in ado.net connection string?

930


Is it possible to edit data in Repeater control?

890


What are the main differences between classic ado and ado.net?

973


List the 4 common ado.net namespaces?

1081


What is a string variable?

868


What is the difference between Optimistic and Pessimistic locking?

927


Define data adapter?

896


What are the parameters that control most of connection pooling behaviors?

945