如何取得Dataset中表table1的某字段的最大值,最小值,平均值,和等

来源:互联网 发布:实参数组类型 编辑:程序博客网 时间:2024/05/21 07:42
object objSUM = this.yourds.Tables[0].Compute("SUM(yourcolumn)","");
object objAVG = this.yourds.Tables[0].Compute("AVG(yourcolumn)","");
object objMAX = this.yourds.Tables[0].Compute("MAX(yourcolumn)","");
object objMIN = this.yourds.Tables[0].Compute("MIN(yourcolumn)","");

decimal dSUM = Convert.ToDecimal("0"+objSUM .ToString());
阅读全文
0 0
原创粉丝点击