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
How to convert a .NET object into COM operabililty?
Differences between namespace, class, assembly?
What is the procedure to add assemly to gac to make it shared one?
What does cli do?
What is web.config in .net?
Difference abstract class and interface in .net?
What is iis? Have you used it?
What is different between webusercontrol and in webcustomcontrol?
How to Create and Consume a Web Service?
What is meant by managed and unmanaged code?
What is a manifest in .net?
How do you view the methods and members of a dll?
Write the .net syntax for 'while loop'?
Is .net core installed?