Golgappa.net | Golgappa.org | BagIndia.net | BodyIndia.Com | CabIndia.net | CarsBikes.net | CarsBikes.org | CashIndia.net | ConsumerIndia.net | CookingIndia.net | DataIndia.net | DealIndia.net | EmailIndia.net | FirstTablet.com | FirstTourist.com | ForsaleIndia.net | IndiaBody.Com | IndiaCab.net | IndiaCash.net | IndiaModel.net | KidForum.net | OfficeIndia.net | PaysIndia.com | RestaurantIndia.net | RestaurantsIndia.net | SaleForum.net | SellForum.net | SoldIndia.com | StarIndia.net | TomatoCab.com | TomatoCabs.com | TownIndia.com
Interested to Buy Any Domain ? << Click Here >> for more details...

Can we use data reader to bind gridview?

Answer Posted / prasanth

data reader can be used to databind gri view

void Page_Load(Object sender, EventArgs e){ String Q; Sql
command cmd; Sql DataReader dr; SqlConnection conn = new
SqlConnection(); conn.ConnectionString =
ConfigurationManager.ConnectionStrings
["cn"].ConnectionString.ToString(); conn.Open
(); Q = "select * from tablename";
cmd= New Sqlcommand(Q, conn); dr =
cmd.ExecuteReader();
Gridview1.DataSource = dr; Gridview1.DataBind();}

Is This Answer Correct ?    17 Yes 4 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

Explain About GDI object ?

1133


how can i create a table from front end to back end in wabe page?

1973


What's a windows process in .net?

1050


What is Flyout Design Pattern in .NET?

1174


What does cli do?

1012


What do you mean by Driver Script?

1220


What are virtual destructures?

1170


What is the difference between function and stored procedure?

1162


What tools can I use to develop .net applications?

1045


Explain why do we use the “using” statement?

1100


What is namespace in .net?

1118


What is Event Bubbling in .NET?

1165


If any body working in Infosys, please can u give me the referense to that company because i hered that their is openings for freshers with referal..

2010


What is boxing and un-boxing in .net?

1112


Do you know what are three common acronyms used in .net, and what do they stand for?

1066