Typed List or RetrievalProcedure?

Posts   
 
    
bonder
User
Posts: 36
Joined: 23-Sep-2003
# Posted on: 17-Apr-2004 04:33:07   

Hi,

I am trying to figure out if it is better (for performance and code readability reasons) to do a query using a typed list or a retrieval procedure. Here is my situation:

I have a number of Orders that I want to pull out of the database and bind to a datagrid. For each Order, I need the following information:

  • Its OrderNumber (pretty easy, this is simply an attribute)
  • The Primary Buyer Full Name (a bit harder; each order can have multiple buyers, but one is marked as primary in a relationship table called OrderBuyer which links an Order with any number of Contact rows)
  • The Seller Full Name (about the same scenario, except that since there is no concept of a "primary seller" we use the first seller listed by a SortOrder attribute)

My big questions are these:

  • Will writing this as a sproc give better performance?
  • Is this query too difficult for a typed list? My concern is that both sellers and buyers exist in the Contact collection.
  • Is there an even better way to do this? Thanks in advance,

--Bruce

Otis avatar
Otis
LLBLGen Pro Team
Posts: 39588
Joined: 17-Aug-2003
# Posted on: 17-Apr-2004 11:09:25   

If the 2 names are retrieved from the same table, a typed list is indeed out of the question as it has to join twice with the same table. (I really really really hate it that it can't be done now, trust me on that, if I had the time to fix it NOW I'd do it, but it has to wait till the next runtime revision.)

For performance reasons, I don't think it would have mattered much.

Frans Bouma | Lead developer LLBLGen Pro
bonder
User
Posts: 36
Joined: 23-Sep-2003
# Posted on: 19-Apr-2004 16:50:30   

Otis wrote:

If the 2 names are retrieved from the same table, a typed list is indeed out of the question as it has to join twice with the same table. (I really really really hate it that it can't be done now, trust me on that, if I had the time to fix it NOW I'd do it, but it has to wait till the next runtime revision.)

For performance reasons, I don't think it would have mattered much.

Thanks for the quick answer (they're all quick answers with you!). simple_smile

For the time being we will code a sproc to handle this. When you get around to this enhancement, we'll convert our code.

Thanks!

--Bruce