<html>
<head>
<title>Binding a GridView to a Data Source Control</title>
<link rel="stylesheet" href="/shared/netdemos.css">
</head>
<body>
<!-- #include virtual="~/shared/top.inc" -->
<div class="header"><h2>Binding a GridView to a Data Source Control</h2></div>
<hr size=1 width=92%>
<form runat="server">
<div align="center">
<asp:gridview id="CustomersGridView" runat="server"
datasourceid="customers"
width=90% cellpadding=5
font-size="9pt"
enableviewstate=false>
<headerstyle backcolor="steelblue"
forecolor="beige" />
<rowstyle verticalalign="top" />
</asp:gridview>
<asp:sqldatasource id="customers" runat="server"
selectcommand="SELECT CustomerID, CompanyName, Address, City, PostalCode, Country FROM Customers"
connectionstring="<%$ ConnectionStrings:aspnet %>"
datasourcemode="DataReader" />
</div>
</form>
<hr size=1 width=92%>
<!-- #include virtual="~/shared/viewsrc.inc" -->
</body>
</html>