过滤数据表中的计算列 [英] Filtering calculated column in datatable

查看:70
本文介绍了过滤数据表中的计算列的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

如果我在某些数据表中有一些带有聚合函数的计算列,该怎么办?根据某些过滤器执行此操作,现在想计算一些数据,我应该对所有数据进行过滤数据表作为一个整体,但是有什么可能 计算数据表显示所有记录的时间

If i have some calculated column with aggregate functions in some data table how can i  do that according to some filters ,Now i  want to calculate some data i should do filtering for all  data table as a whole but what need that is it possible to calculate while data table displaying all records

谢谢

亲爱的卡伦,

这次我避免考虑使用语法工具纠正,让自己放松;)  :*:*:-*

this time i  am avoided considering Grammarly tool  correction so feel relax  ;)  :* :* :-*

推荐答案

通过计算得出,您的意思是使用表达式

By calculated do you mean using an Expression

dt.Columns.Add(new DataColumn()
{
    ColumnName = "Total",
    DataType = typeof(int),
    Expression = "Cost * Markup"
});


这篇关于过滤数据表中的计算列的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆