Well, you can take several approaches.
Approach #1 - Standard Query
The first approach would just be to execute the query and bring it into a BO. Remember, you are dealing with disconnected data so you really don't have to add this to a temp cursor as BO (or DataTable within the BO) is your temp cursor. A query doesn't have to match the structure of the BO...you can bring back any query you want. So it would look something like this:
MyBO.FillDataTable("SELECT date as xdate,cdesc as Service,SUM(num_pax) FROM tempo1 GROUP BY xdate,Service")
You can then access the populated table via the strong-typed properties...or custom properties...or just by accessing the MyBo.CurrentRow.Item("MyField")
Approach #2 - Multiple Result Sets
Remember that there is a new method on the BusinessLayer that allows you to bring back as many result sets as you need...this is very nice when you need to execute multiple queries:
Dim cmd As New SqlCommand("SELECT date as xdate,cdesc as Service,SUM(num_pax) FROM tempo1 GROUP BY xdate,Service;" & _
"SELECT CAST(CDOW(xdate)as character(10)) as xday,xdate,Service,sum_num_pax as pax FROM tempo2;")
MicroFour.StrataFrame.Business.BusinessLayer.FillMultipleDataTables(cmd, _
MyBO1, _
MyBO2)
Approach #3 - True Temp Cursors in SQL Server
If you really need to create a temp cursor, then this would be done within a stored procedure but ultimately you would be bringing back a result set like above. The only difference would be that you have done all of the query work on the SQL Sproc side prior to coming back over to the client. There are a lot of articles on creating temp tables in SQL Server. The quick and dirty version is that when you create a table with a # it is a local cursor and when you create a table with a ## it is a global cursor. But I really don't think that this is the approach that you need so I will not expand much on this.