我有这个 GridView :
<asp:GridView ID="GridView1" runat="server" DataSourceID="SqlDataSource1"
AllowPaging="True" PageSize="20" CellPadding="4" ForeColor="#333333" GridLines="None">
<AlternatingRowStyle BackColor="White" />
<EditRowStyle BackColor="#2461BF" />
<FooterStyle BackColor="#507CD1" Font-Bold="True" ForeColor="White" />
<HeaderStyle BackColor="#507CD1" Font-Bold="True" ForeColor="White" />
<PagerStyle BackColor="#2461BF" ForeColor="White" HorizontalAlign="Center" />
<RowStyle BackColor="#EFF3FB" />
<SelectedRowStyle BackColor="#D1DDF1" Font-Bold="True" ForeColor="#333333" />
<SortedAscendingCellStyle BackColor="#F5F7FB" />
<SortedAscendingHeaderStyle BackColor="#6D95E1" />
<SortedDescendingCellStyle BackColor="#E9EBEF" />
<SortedDescendingHeaderStyle BackColor="#4870BE" />
</asp:GridView>
这个ID是SqlDataSource1
:
<asp:SqlDataSource ID="SqlDataSource1" runat="server"
ConnectionString="<%$ ConnectionStrings:connectionString %>"
ProviderName="<%$ ConnectionStrings:connectionString.ProviderName %>"
SelectCommand="SELECT count(city),city FROM users GROUP by city ORDER BY count(city) DESC;" ></asp:SqlDataSource>
在GridView
列的标题中是count(city),city
.
我应该如何更改列名?