Doron,
This is exactly what I had expected to see when I was posting my previous responses. Here is what you need to do. Create a SPROC that will retrieve all of the results that you are wanting to see, even if they come back in more than one result set.
Let's keep this simple. Two tables:
Customers
CustomerPhoneNumbers
Now I want to show in the list you provided all of the phone numbers in a flat list. So the first thing I would do is get the query the way I like it, create a BO for each that may be used here (i.e. CustomersBO, CustomerPhoneNumbersBO). Then I might treat this like a report if this is going to be for display purposes and then add a link (or whatever mechanism you intend to use) to an editing page if they want to make changes. So in this case, I might inherit the CustomersBO and add all of the custom properties that I need for this display while not "messing up" the original BO since these custom properties will not be used everyone.
Public Class MyCustomBo
Inherits CustomersBO
Private Shared _PhoneNumbers As New CustomerPhoneNumbersBO()
Public Readonly Property PhoneNumbers() As CustomerPhoneNumbersBO
Get
Return _PhoneNumbers
End Get
End Property
End Class
So now when I call my stored procedure that retrieves all of my result sets, I will dump it into this BO like this:
Private _MyCustomBO As New MyCustomBo()
Private Sub LoadData()
Dim cmd As New SqlCommand("dbo.MySproc")
cmd.CommandType = SqlCommandType.StoredProcedure
MicroFour.StrataFrame.Business.BusinessLayer.FillMultipleDataTables(cmd, _MyCustomBO, _MyCustomBO.PhoneNumbers)
End Sub
So now I have a single entry point with two BOs. This is the same type of logic you would use for a report. So now, go one further and create a custom property to show all of the phone numbers on the entry point BO:
Public Class MyCustomBo
Inherits CustomersBO
Private Shared _PhoneNumbers As New CustomerPhoneNumbersBO()
Public Readonly Property PhoneNumbers() As CustomerPhoneNumbersBO
Get
Return _PhoneNumbers
End Get
End Property
Public Readonly Property My_PhoneNumbersAsHtml() As String
Get
Dim r As String = ""
For Each bo As CustomerPhoneNumbersBO in _PhoneNumbers
r &= bo.PhoneNumberAsText & "<br>"
Next
Return r
End Get
End Property
End Class
This should get you going in the right direction.