Typed List - sql error - no inner join

Posts   
 
    
knodd
User
Posts: 3
Joined: 23-May-2008
# Posted on: 23-May-2008 10:00:24   

I'm trying to create a Typed List based on two related entities Frukt and Kategori (swedish for Fruit and Category, sorry for that)

The entities are based on the following tables in my testdb:


Frukt

fruktId (PK) Namn

kategoriId (FK)


Kategori

kategoriId (PK)

Namn

I have designed the typed list to include fruktId and Namn from entity Frukt and Namn (with alias Kategori) from entity Kategori.

When using the generated code to fetch rows from the typed list I got teh following error:

System.Data.SqlClient.SqlException: The multi-part identifier "llbltest.dbo.Kategori.namn" could not be bound..

Tracing the SQL generated by the llblgen-code I see the problem. The inner join to table Kategori is missing:

SELECT [llbltest].[dbo].[Frukt].[fruktId] AS [FruktId], [llbltest].[dbo].[Frukt].[namn] AS [Namn], [llbltest].[dbo].[Kategori].[namn] AS [Kategori] FROM [llbltest].[dbo].[Frukt] 

It should be something like this to work:

SELECT [llbltest].[dbo].[Frukt].[fruktId] AS [FruktId], [llbltest].[dbo].[Frukt].[namn] AS [Namn], [llbltest].[dbo].[Kategori].[namn] AS [Kategori] 
FROM [llbltest].[dbo].[Frukt] 
INNER JOIN [llbltest].[dbo].[Kategori] ON [llbltest].[dbo].[Frukt].[kategoriId] =[llbltest].[dbo].[Kategori].[kategoriId]

So, what am I doing wrong here? Why isn't the correct sql generated?

Regards.

Walaa avatar
Walaa
Support Team
Posts: 14994
Joined: 21-Aug-2005
# Posted on: 23-May-2008 10:29:49   

Which LLBLGen Pro Designer version (release date) are you using? Which LLBLGen Pro runtime library version are you using?

Would you please make sure that the relation between Fruit and Category is not hidden in any of the both sides of the relation?

knodd
User
Posts: 3
Joined: 23-May-2008
# Posted on: 23-May-2008 12:26:46   

I'm using:

LLBLGen Pro Designer version: 2.5 Final, Release on March 28th, 2008 Runtime version: v2.0.50727

I just checked and the the relation is not hidden in any of the sides.

After looking mor into the issue I suspect this has something to do with paging and counting rows. Don't know how to get around this though.

Walaa avatar
Walaa
Support Team
Posts: 14994
Joined: 21-Aug-2005
# Posted on: 23-May-2008 15:08:44   

Would you post a repro solution with the lgp file?