<%@ Page Language="C#" AutoEventWireup="true"  CodeFile="Default.aspx.cs" 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>SqlDataSource控件的应用</title>
</head>
<body>
    <form id="form1" runat="server">
    <div>
    
        <asp:SqlDataSource ID="SqlDataSource1" runat="server" 
            ConnectionString="<%$ ConnectionStrings:SQL_DataConnectionString %>" 
            SelectCommand="SELECT [仓库号], [城市], [面积], [创建时间] FROM [仓库]">
        </asp:SqlDataSource>
        <asp:DataList ID="DataList1" runat="server" BackColor="LightGoldenrodYellow" 
            BorderColor="Tan" BorderWidth="1px" CellPadding="2" 
            DataSourceID="SqlDataSource1" ForeColor="Black" Width="322px">
            <FooterStyle BackColor="Tan" />
            <AlternatingItemStyle BackColor="PaleGoldenrod" />
            <SelectedItemStyle BackColor="DarkSlateBlue" ForeColor="GhostWhite" />
            <HeaderStyle BackColor="Tan" Font-Bold="True" />
            <ItemTemplate>
                仓库号:
                <asp:Label ID="仓库号Label" runat="server" Text='<%# Eval("仓库号") %>' />
                <br />
                城市:
                <asp:Label ID="城市Label" runat="server" Text='<%# Eval("城市") %>' />
                <br />
                面积:
                <asp:Label ID="面积Label" runat="server" Text='<%# Eval("面积") %>' />
                <br />
                创建时间:
                <asp:Label ID="创建时间Label" runat="server" Text='<%# Eval("创建时间") %>' />
                <br />
                <br />
            </ItemTemplate>
        </asp:DataList>
    
    </div>
    </form>
</body>
</html>
