Can we use data reader to bind gridview?

Answer Posted / swathi

this is also same as the Dataset.
these are steps:
1. SqlConnection con=new SqlConnection(ConnectionString);
2. SqlCommand com=new SqlCommand("Select * from
TableNAme",con);
3. SqlDataReader dr;
4. con.open();
5. dr=com.ExecuteReader();
6. Datagrid1.DataSource=dr;
7. DataGrid1.DataBind();

Is This Answer Correct ?    6 Yes 0 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

What is .net technology?

571


Tell about your technical profile ?

3098


How to load the contents of an xml file into an xmldocument object?

597


What is jit compilers?

573


Can you give an example of when it would be appropriate to use a web service as opposed to a non-serviced .NET component

1846






What is the benefit of .net core?

492


Explain me what is .net web service?

551


What is the advantage of .net?

535


What is meant by globalization?

568


What is "microsoft intermediate language" (msil)?

521


How is .net able to support a lot of languages?

538


What is connected and diconnected database ?

589


How do you define the lease of the object in .net?

554


How will you make .NET programs work in Linux ?

1488


Interop Services?

1456