Hi,
First of all, we are using SQL Server 2005 Express with Adapter method.
I am trying to traverse a many-to-many relationship and I'm getting an exception: 'The multi-part identifier "CountWA.dbo.USER_ROLE_TB.USER_ID" could not be bound...'.
This appears to be caused by missing alias names in the select list - here is the generated SQL:
Query:
SELECT DISTINCT [CountWA].[dbo].[USER_ROLE_TB].[USER_ROLE_ID] AS [UserRoleId],
[CountWA].[dbo].[USER_ROLE_TB].[USER_ID] AS [UserId],
[CountWA].[dbo].[USER_ROLE_TB].[ROLE_ID] AS [RoleId]
FROM
(( [CountWA].[dbo].[USER_TB] [LPA__1] INNER JOIN [CountWA].[dbo].[USER_ROLE_TB] [LPA_U2] ON [LPA__1].[USER_ID]=[LPA_U2].[USER_ID]) INNER JOIN [CountWA].[dbo].[ROLE_TB] ON [CountWA].[dbo].[ROLE_TB].[ROLE_ID]=[LPA_U2].[ROLE_ID]) WHERE ( ( [LPA__1].[USER_ID] = @UserId1))
Parameter: @UserId1 : Int32. Length: 0. Precision: 10. Scale: 0. Direction: Input. Value: 46.
Any ideas appreciated.
Thanks,
Scott.