I have something like this sql query : Select Sum(value) from Database.table
. And i post this in to some gridView in asp.net web form.
<asp:gridview id="foo" runat="server" autogeneratecolumns="false">
<columns>
<asp:boundfield datafield="ID" headertext="Identifier" />
</columns>
</asp:gridview>
this Sum(VALUE)
don't have datafield
or i dont know what is this .How to change HeaderText of SUM(value) column
您应该使用Select Sum(value)AS SomeColumnName并将其用作数据字段。
Select Sum(value) As ColumnName from Database.table
将ColumnName替换为您想要赋予该列的任何名称。
You nee to use an ALIAS
and then use it inside your DataField
Select Sum(value) AS SumOfValue from Database.table
Then
<columns>
<asp:boundfield datafield="SumOfValue" headertext="Identifier" /> // use the alias name here
</columns>
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.