Asp.Net-informations.com   Advertisement
     SiteMap

ASP.NET Simple GridView

The GridView control provides many built-in capabilities that allow the user to sort, update, delete, select, and page through items in the control. The GridView control can be bound to a data source control, in order to bind a data source control, set the DataSourceID property of the GridView control to the ID value of the data source control.

  

<asp:SqlDataSource ID="SqlDataSource1" runat="server"
ConnectionString="<%$ ConnectionStrings:SQLDbConnection %>"
SelectCommand="select * from stores" />

simple-gridview

The following ASP.NET program shows how to display a collection of data in a gridview .

Default.aspx

  

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head id="Head1" runat="server">
	<title>Untitled Page</title>
</head>
<body>
	<form id="form1" runat="server">
	<div>
		<asp:GridView ID="GridView1" runat="server" DataSourceID="SqlDataSource1" />
		<asp:SqlDataSource ID="SqlDataSource1" runat="server"
		ConnectionString="<%$ ConnectionStrings:SQLDbConnection %>"
		SelectCommand="select * from stores" />
	</div>
	</form>
</body>
</html>




ASP.NET GridView - Related Contents


More Source Code :
|  Home  |   VB.NET  |   C#  |   ASP.NET  |   SiteMap  |   Terms of Use  |   About  |