数据表的计算功能 [英] compute function of datatable
问题描述
我想使用datable的计算功能通过数据集中的可用列获取列组的总和和平均值,并给出查询之类的结果以将其绑定到gridview.
例如
我有13列的查询结果,并且必须根据用户从列表中选择的列显示这些结果.
如果用户选择其中的其中一个,则假定以下列
empID varchar(200),
emp_Name varchar(200),
性能数值(8,2)
现在我有上述列的数据表
所以在这里我必须根据表中的其他列计算性能总和,那么我该怎么做呢?
我再次需要结果来将datasoure分配给gridview
如果您有其他解决方案,请分享.
I want to use compute function of datable to get sum and avg of column group by to available columns in dataset and give result like query to bind this to an gridview.
e.g
I have result of query with 13 columns and I have to show these result according columns select by User from list.
of which if user have selected suppose following columns
empID varchar(200),
emp_Name varchar(200),
Performance numeric(8,2)
and now i have datatable of above mentioned columns
so here I have to calculate sum of Performance according to other columns in the table so how should i do it?
I need result again to assign datasoure to gridview
If you have other solution then please share.
推荐答案
请参阅本文,不确定是否会帮助您
http://aspguy.wordpress.com/2008/06/08/datatablecompute-method -is-lovely/ [ ^ ]
Refer this article, not sure will help you
http://aspguy.wordpress.com/2008/06/08/datatablecompute-method-is-lovely/[^]
这篇关于数据表的计算功能的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!