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
Whate are resource files?
How will you register com+ services?
Explain the garbage collection process?
what is the keyword used for self reference?
What is the difference between constants and read-only variables?
What is iis? Have you used it?
How many namespaces are in .net version 1.1?
What is the single responsibility principle?
Explain the features that are common to all .Net languages.
How do you instantiate a complex number?
Is .net capable of supporting multi-thread?
Which namespace is require to used XML in .NET?
I am constantly writing the drawing procedures with system.drawing.graphics, but having to use the try and dispose blocks is too time-consuming with graphicsobjects. Can I automate this?
How we can achieve Connection pooling in .Net?
What does cli do?