统计单行或多行Gridview某列的总数
来源:互联网 发布:linux查看运行内存大小 编辑:程序博客网 时间:2024/06/04 17:11
前台代码:
<asp:Panel ID="Panel1" runat="server" Visible="false">
<div class="headresult">
<asp:Literal ID="ltResult1" runat="server"></asp:Literal>
</div>
</asp:Panel>
<asp:Panel ID="Panel2" runat="server" Visible="false">
<div class="headresult">
<asp:Literal ID="ltResult2" runat="server"></asp:Literal>
</div>
</asp:Panel>
后置代码:
DataTable dt = MSCL.SqlHelper.GetDataTable(strSql); //绑定Gridview中所有数据
if (dt.Rows.Count > 0) //如果Gridview中大于0条数据,则绑定并显示Panel(控制面板控件)里的值
{
#region
string ProductCount = dt.Compute("sum(productnumber)", null).ToString(); //重点语句
string PriceCount = dt.Compute("sum(prototalprcie)", null).ToString();
string Blank = " ";
Panel1.Visible = true;
Panel2.Visible = true;
string result = "查询" + begintime;
result = result + (!string.IsNullOrEmpty(endtime) ? ("至" + endtime) : "");
result = result + Blank + "商品数量总计:<span class='headresultred'>" + ProductCount + "</span>" + Blank + "商品金额总计:<span class='headresultred'>" + PriceCount + "</span>" + Blank;
ltResult1.Text = result;
ltResult2.Text = result;
#endregion
}
else
{
Panel1.Visible = false;
Panel2.Visible = false;
}
- 统计单行或多行Gridview某列的总数
- GridView统计单列或多列的总数
- GridView中根据CheckBox选中的行取出某列的值及计算数据列的总数
- gridview安卓实现单行多列横向滚动
- gridview安卓实现单行多列横向滚动
- Gridview中合并相同的行或列
- 冻结GridView的列或头部
- latex 单行或多行公式的排版
- latex 单行或多行公式的排版
- LaTex 单行或多行公式的排版
- GridView模版列里的按钮取GridView当前被操作行的数据或id
- 统计记录总数的语句
- 统计某年的字段总数
- 总数统计
- GridView 合并行或列
- gridview 隐藏数据列或表头列
- C# GridView 给某行或某列绑定点击事件和鼠标事件
- 统计各type的消息的总数
- Gerrit 添加一个已经有的git工程到gerrit服务器
- java笔试题(引自传智播客)-上
- django开发环境搭建(参考流程)
- 对compatible参数的理解【待完成】
- 单片机控制点阵俄罗斯方块的程序源码
- 统计单行或多行Gridview某列的总数
- 使用jqMobi开发app基础:注销页面的实现
- Python-Project Euler 39
- iOS中UIImage转换为NSData 方法
- 如何在CSDN博客添加链接
- linux中dir命令参数应用
- Java 访问带有密码的 Mysql数据库
- 四、中英翻译、歌词、藏头诗、智能聊天
- CEX 云矿机盈利模式费用计算