作为集合执行

时间:2010-01-19 04:47:30

标签: subsonic

我使用了亚音速(2.2版)来编写查询。如何将其返回列表或集合。在加载到集合中后,如何根据用户想要查看的内容添加过滤。实际上这是一个报表查询,用户可以应用过滤,因此我无法在查询中应用这些过滤。

Dim qry As SqlQuery = New SubSonic.Select("bill.bill_no as 'Bill No'", "product.descript as 'Product Desc'", "product.misc_desc as 'Product Misc Desc'", "sbipterm.terms_code as 'Term Code'", "billdet.term_amt as 'Term Amount'", "customer.name as 'Customer Name'", "customer.address1 as 'Customer Address'", "customer.city as 'City'", "distmas.ds_name as 'District'", "customer.pincode as 'Pincode'", "customer.telephone as 'Telephone'").From("Bill").InnerJoin("customer", "custcode", "bill", "custcode").InnerJoin("billdet", "bill_no", "bill", "bill_no").InnerJoin("sbipterm", "bill_no", "bill", "bill_no").InnerJoin("product", "prodcode", "billdet", "prodcode").InnerJoin("distmas", "ds_code", "customer", "ds_code")

1 个答案:

答案 0 :(得分:4)

有点讽刺的是,你将这个问题称为“执​​行为集合”,因为这正是你想要的方法:ExecuteAsCollection()。

此外 - 在发布问题之前阅读文档并没有什么坏处。我花了很多时间为人们搞砸了东西 - 我意识到它并不尽可能完整但是......认真的答案就在这里:

http://subsonicproject.com/docs/Simple_Query_Tool