<form id="form1" runat="server">
    <div>    
        <asp:GridView ID="GridView1" runat="server"
                    AllowPaging="true"
                    AllowShorting="true"
                    AutoGenerateColumns="false"
                    EnableSortingAndPagingCallbacks="true"
                    Width="280"
                    BackColor="#ccccff"
                    BorderColor="black"
                    ShowFooter="false"
                    CellPadding="3"
                    CellSpacing="0"
                    Font-Name="Verdana"
                    Font-size="11pt"
                    HeaderStyle-BackColor="#aaaadd"
                    EnableViewState="false"
                    DataSouceID="mySqlDataSource">
                <Columns>
                    <asp:BoundField DataField="storehouse_time" HeaderText="录入日期" ReadOnly="true" SortExpression="storehouse_time" />                 
                </Columns>                    
                </asp:GridView>                                                  
                <asp:SqlDataSource ID="mySqlDataSource" runat="server" 
                     ConnectionString="server=localhost;database=ASL;user id=sa;password=1;" SelectCommand = "select [storehouse_time] from [LookRecord]">
                     </asp:SqlDataSource>
    
    </div>
    </form>为什么页面不显示数据呢??

解决方案 »

  1.   

    server=localhost;database=ASL;user id=sa;password=1;确认连接字符串正确本机存在ASL库 且库不是EXPRESS版本
      

  2.   

    要么数据库没数据    要么sql语句有问题    要么绑定有问题 
    排查
      

  3.   

    select [storehouse_time] from [LookRecord] 在数据库,有数据不?
      

  4.   

    在数据库里执行一下你的sql语句,好像是serve=localhost 这个有问题吧,数据库名字,或者.都可以的!
      

  5.   

    哥给你找出来错误了,你知道哪个错了吗?DataSouceID="mySqlDataSource"
    改成
    DataSourceID="mySqlDataSource"真粗心!!