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 is ado rdo dao in visual basic?
What is the difference between linq and ado.net?
Which one of the following objects is a high-level abstraction of the connection and command objects in ado.net?
Which method is used by command class to execute SQL statements that return single value?
What is read only and forward only in ado.net?
Explain the namespaces in which .net has the data functionality class.
What is oledb driver?
Data reader read and forward only, how is it possible to get 2 tables of data at a time?
How to add a javaScript function in a datagrid?
What is difference between connected and disconnected architecture in ado.net?
Explain how to pass multiple tables in datasets simultaneously?
Explain sqlconnection object?
What is the use of connection object in ado.net?
What are the connected and disconnected modes in ado.net?
What is variable view?