Looked-up values in columns using bound collection...

Posts   
 
    
JSobell
User
Posts: 151
Joined: 07-Jan-2006
# Posted on: 28-Jun-2006 05:31:24   

I may be missing something basic here, but I'm trying to bind an EntityCollection object, SelfServicing, in LLBLGen v2b to a DevExpress grid component and I'm having problems. I've created the relationship in the designer, the child tables exist, added the apropriate looked-up values as "Fields mapped on related fields", and set these to read-only just in case. When I bind this to the grid everything is fine, except that when I trace the connection I find that thousands of requests go to the server for data, with several being requested for each row. This occurs when data is sorted in the columns too. I assume this is because the base Entity is not caching the associated lookup values. What is the correct way to approach this type of situation? It's a common situation in any normalized database, and I realize that a view could be used to return the information initially, but this would not be updatable.

Oh, and can we please have a copy of the v2 .NET2 files as a chm? I despise the new .NET help format, and it takes so long to load that it's quicker to Google most solutions simple_smile

Cheers, Jason

Otis avatar
Otis
LLBLGen Pro Team
Posts: 39928
Joined: 17-Aug-2003
# Posted on: 28-Jun-2006 10:26:38   

JSobell wrote:

I may be missing something basic here, but I'm trying to bind an EntityCollection object, SelfServicing, in LLBLGen v2b to a DevExpress grid component and I'm having problems. I've created the relationship in the designer, the child tables exist, added the apropriate looked-up values as "Fields mapped on related fields", and set these to read-only just in case. When I bind this to the grid everything is fine, except that when I trace the connection I find that thousands of requests go to the server for data, with several being requested for each row. This occurs when data is sorted in the columns too.

You've to fetch the data in a prefetch path before you bind to a grid. If you don't every field mapped onto a related field will trigger lazy loading for that single related entity. This thus means a lot of queries.

Oh, and can we please have a copy of the v2 .NET2 files as a chm? I despise the new .NET help format, and it takes so long to load that it's quicker to Google most solutions simple_smile

You mean the reference manual? I wished I could have the files as a .chm, but ndoc failed to create a proper .chm file for .NET 2.0 assemblies so we purchased document X 5 to do that for us, which generated vs.net 2005 helpfiles. It's also an advantage to have them as vs.net helpfiles as you can now press F1 in the editor and you get help in the ide simple_smile

Frans Bouma | Lead developer LLBLGen Pro
JSobell
User
Posts: 151
Joined: 07-Jan-2006
# Posted on: 29-Jun-2006 06:21:12   

Ah, I see. I understood the reason it was an issue, but completely overlooked the Prefetch path stuff.

Many thanks for that info.

Cheers, Jason