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

How to implement CAS in .Net?

2585


What is the use of common language runtime?

812


Differences between namespace, class, assembly?

776


Which dll translate xml to sql in internet information server (iis)?

800


What is the difference between web application and enterprise application?

782


Explain cas (code access security)?

798


What is .net standard?

802


What is "microsoft intermediate language" (msil)?

741


What are the security policy levels in .Net

1800


Sql Queries: A Table will be given Omiting Duplicate rows and adding a new column

2138


Explain difference between panel and groupbox classes using .net?

726


Do you know what is the difference between an abstract class and an interface?

769


I'm having some trouble with cas. How can I troubleshoot the problem?

768


Explain what inheritance is, and why it's important?

706


object is physical and class is logical..here class is not occupying any memory as our definition of class but i got a question then the class where it stores if it is not occupying any memory....

1858