Compute函数的参数就两个:Expression,和Filter。
Expresstion是计算表达式,而Filter则是条件过滤器,类似sql的Where条件。
参考博客http://blog.csdn.net/smartsmile2012/article/details/8309664
在项目组里运用的地方是,从dataset里取出一个字段的综合,条件是状态为退票和票号是本表的一个字段
object obj = ds.Tables[0].Compute("sum(RefundAmount)", "OnlineRecordStatus='退票' and OnlineRecordTicketNo='" + ds.Tables[0].Rows[1]["OnlineRecordTicketNo"].ToString() + "'");
参考网页http://www.cnblogs.com/li-peng/archive/2012/11/30/2795852.html
DataTable BillListDT = ds.Tables[0].DefaultView.ToTable(true, "OnlineRecordTicketNo", "OnlineRecordTranDate", "OnlineRecordCardNumber", "RefNum", "AuthCode", "Actualcollect", "OnlineRecordAmount");
DataTable BillListDT = _filterDT.DFilter("", new[] {"BillID"});