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 meant by executenonquery?
Why do we need ado.net?
Explain how do you connect to sql server database without using sqlclient?
What does ado stand for in ado.net?
Does entity framework use ado.net?
Explain what are acid properties?
What connected data?
How to read data with the sqldatareader ?
Is entity framework better than ado.net?
Can datareader hold data from multiple tables?
Can we create Synonymns in MS Acess,My Sql Server,Sql Server? But iam we can create in oracle!
What are the advantages of using datalist?
How does entity framework work?
What is the full form of ado?
How to create dynamic gridview?