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
What are the ado.net connection pooling parameters?
Explain what are acid properties?
What is ado circle?
How can you add or remove rows from the datatable object of dataset?
What are the different execute methods of Ado.Net?
What is the use of connection object in ado.net?
What is method to get XML and schema from Dataset? getXML() and get Schema ()
how to create a quiz software using 4 options to answer and how to check with answers in the database and award marks....
Explain the difference between data reader and data adapter?
List the 4 common ado.net namespaces?
What are two important objects of ADO.Net?
What is the purpose of using adodb?
If a table contains 20000 records. In a page at each time 100 records to be displayed.
What is two way data binding android?
Explain why edit is not possible in repeater?