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

Which architecture does Datasets follow?

797


What is openquery?

721


What is the difference between Response.Expires and Reponse.ExpiresAbsolute?

790


can we create synonymn in ms access,sql server,my sql if so explain me with example

1827


What are the benefits of ADO.NET?

854


Define ado.net?

804


What is ado.net and its architecture?

717


Which is faster dataset or datareader?

723


What are the steps to connect to a database?

749


Which is faster entity framework or ado.net?

698


What is the use of ADO.NET and XML web services?

794


What is bubbled event?

724


What is data relation?

684


What is difference between ado and other data object?

670


How many major types of connection objects in ADO.NET?

805