<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>为什么页面不显示数据呢??
<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>为什么页面不显示数据呢??
排查
改成
DataSourceID="mySqlDataSource"真粗心!!