Search code examples
subsonic

execute as collection


I've used subsonic(version 2.2) to write a query. How can i return it to a list or collection. And after this loaded into a collection how can i add filtering based on what user wants to see. Actually this is a report query and user can apply filtering so i cannot apply those filtering in the query.

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")

Solution

  • It's a tad ironic that you titled this question "execute as collection" as that's precisely the method you want: ExecuteAsCollection().

    Also - it doesn't hurt to read the docs before posting your questions. I've spent a whole mess of time to get stuff down for people - I realize it's not as complete as possible but... seriously your answer is right here:

    http://subsonicproject.com/docs/Simple_Query_Tool