The following is the source code for the Default.aspx page
and it includes all the modifications to the design applied to retrieve the
result displayed in Figure 25.
Listing 1
<%@ Page Language="VB" AutoEventWireup="false"
CodeFile="Default.aspx.vb" Inherits="_Default" %>
<!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 runat="server">
<title>Untitled Page</title>
</head>
<body>
<h3>Northwind Employees Data</h3>
<form id="form1" runat="server">
<div>
<asp:GridView ID="GridView1"
runat="server"
AutoGenerateColumns="False"
DataSourceID="SqlDataSource1"
EmptyDataText="There are no data records to display."
AllowPaging="True"
AllowSorting="True"
BackColor="White"
BorderColor="#DEDFDE"
BorderStyle="None"
BorderWidth="1px"
CellPadding="4"
ForeColor="Black"
GridLines="Vertical">
<FooterStyle BackColor="#CCCC99" />
<RowStyle BackColor="#F7F7DE" />
<SelectedRowStyle BackColor="#CE5D5A"
Font-Bold="True"
ForeColor="White" />
<PagerStyle BackColor="#F7F7DE"
ForeColor="Black"
HorizontalAlign="Right" />
<HeaderStyle BackColor="#6B696B"
Font-Bold="True"
ForeColor="White" />
<AlternatingRowStyle BackColor="White" />
<Columns>
<asp:BoundField DataField="EmployeeID"
HeaderText="EmployeeID"
InsertVisible="False"
ReadOnly="True"
SortExpression="EmployeeID" />
<asp:BoundField DataField="LastName"
HeaderText="LastName"
SortExpression="LastName" />
<asp:BoundField DataField="FirstName"
HeaderText="FirstName"
SortExpression="FirstName" />
<asp:BoundField DataField="City"
HeaderText="City"
SortExpression="City" />
<asp:BoundField DataField="PostalCode"
HeaderText="PostalCode"
SortExpression="PostalCode" />
<asp:BoundField DataField="Country"
HeaderText="Country"
SortExpression="Country" />
</Columns>
</asp:GridView>
<asp:SqlDataSource
ID="SqlDataSource1"
runat="server"
ConnectionString="<%$ ConnectionStrings:NorthwindConnectionString1 %>"
ProviderName="<%$ ConnectionStrings:NorthwindConnectionString1.ProviderName %>"
SelectCommand="SELECT [EmployeeID],
[LastName], [FirstName], [City],
[PostalCode], [Country], [Photo],
[PhotoPath] FROM [Employees]">
</asp:SqlDataSource>
</div>
</form>
</body>
</html>