日期:2014-05-19  浏览次数:20510 次

GridView从数据库读数据显示问题
代码文件   ***********************

<%@   Page   Language= "VB "%>

<html   xmlns= "http://www.w3.org/1999/xhtml "   >
<head   runat= "server ">
        <title> GridView   &   DetailsView   Controls </title>
</head>
<body>
        <form   id= "form1 "   runat= "server ">
            <p>
                <asp:GridView   ID= "GridView1 "   runat= "server "   DataSourceID= "SqlDataSource1 "   AllowPaging= "true "  
                    BorderColor= "#DEBA84 "   BorderStyle= "none "   BorderWidth= "1px "   BackColor= "#DEBA84 "   CellSpacing= "2 "  
                    cellpadding= "3 "   DataKeyNames= "CustomerID "   AutoGenerateSelectButton= "true "    
                    autogenerateColumns= "false "   PageSize= "5 ">
                    <FooterStyle   ForeColor= "#8C4510 "   BackColor= "#F7DFB5 "   />
                    <PagerStyle   ForeColor= "#8c4510 "   HorizontalAlign= "Center "   />
                    <HeaderStyle   ForeColor= "White "   BackColor= "#A55129 "   Font-Bold= "true "   />
                    <Columns>
                        <asp:BoundField   ReadOnly= "true "   HeaderText= "CustomerID "   DataField= "CustomerID "
                            sortExpression= "CustomerID "   />
                        <asp:BoundField   HeaderText= "CompanyName "   datafield= "CompanyName "  
                            SortExpression= "companyName "   />
                        <asp:BoundField   HeaderText= "ContactName "   DataField= "contactName "  
                            sortExpression= "contactName "   />
                        <asp:BoundField   HeaderText= "ContactTitle "   DataField= "ContactTitle "
                            sortExpression= "ContactTitle "   />
                        <asp:BoundFie