1

如何将这 3 个查询组合在一起并将它们作为数据表返回:

1:

var TDD = 0;
                var queryTDD = (from x in db.GetAll<WMINO>()
                                 join y in db.GetAll<WMCTM>()
                                 on x.PO_ID equals y.Contract_ID
                                 select new
                                 {
                                     TDD = x.Payable,
                                 });

2:

 Decimal TotalToDatePayable = 0;
            TotalToDatePayable = ((from ori in db.GetAll<WMPORI>()
                                      join ctm in db.GetAll<WMCTM>()
                                      on ori.CTMSysID equals ctm.CTMSysID
                                      select ori.ExB4Taxes).Sum());     

3:

  var query = from ctm in db.GetAll<WMCTM>()
                        join vnm in db.GetAll<WMVNM>()
                        on ctm.VendSysID equals vnm.VendSysID
                        where ctm.WONOs == workOrder && ctm.TransType == "Purchase Order"


select new
                            {
                                ctm.CTMSysID,
                                ctm.Contract_ID,
                                ctm.VNM_ID};`

任何帮助表示赞赏

4

1 回答 1

2

这是不可能的,因为每个查询都有不同的结果并使用不同的列和条件......

组合这些查询没有任何意义......

于 2012-05-29T15:10:54.420 回答