Why sql Data Reader object not created

Answer Posted / kalirajan

SqlConnection con = new SqlConnection("");
con.Open();
SqlCommand cmd = new SqlCommand("", con);

SqlDataReader dr;

dr = cmd.ExecuteReader();
while (dr.Read())
{
TextBox1.Text = dr[0].ToString();


}

dr.Close();


Try this code...

Is This Answer Correct ?    8 Yes 8 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

What is the role of clr?

745


Explain the various objects in dataset.

749


Explain the difference in record set and dataset?

711


What is the full form of ado?

705


What are the data providers in ADO.NET framework?

795


Explain the differences between oledb sql server, oledbdotnet provider?

775


Describe connection object in ado.net

776


Why ca not we use multiple inheritance and garbage collector paralelly in .net?

785


What is ado.net code?

731


What is the full form of ado.net?

760


What two types of data providers does ADO.NET supply? What determines which one you should use?

765


Explain the two fundamental objects in ado.net?

699


Explain the different row versions available in table?

765


What is different between sqlcommand object and command behavior object?

763


What is data relation?

700