Possible bug with Any()

Posts   
 
    
JMuller
User
Posts: 19
Joined: 09-Mar-2009
# Posted on: 31-Aug-2010 16:58:14   

Hi,

Im trying to execute the following query:



using (DataAccessAdapter adapter = new DataAccessAdapter())
{
    LinqMetaData metaData = new LinqMetaData(adapter);

            
    var customers = from nv in metaData.Customer
            where ((nv.Emailaddress == klantRow.Emailaddress &&
                         nv.LastName == klantRow.Emailaddress ) ||
                    (nv.Postalcode == klantRow.Postalcode &&
                     nv.HouseNumber == klantRow.HouseNumber &&
                     nv.LastName == klantRow.LastName )) &&
                     nv.CustomerId != klantRow.CustomerId 
     select nv;
    
         if (klanten.Any())
    {
        //TODO
    }
}


but this returns the following error:


An exception was caught during the execution of a retrieval query: 
The multi-part identifier \"LPA_L1.Emailaddress \" could not be bound.
And alot more fields could not be bound.

The generated query:



SELECT TOP(@top6) CASE WHEN EXISTS (
    SELECT [LPA_L1].[CustomerId] FROM (
        [LPA_L1].[Emailaddress ] AS [Emailaddress]
        FROM [KNM].[dbo].[Customers] [LPLA_1]  
        WHERE ( ( ( ( 
            ( [LPA_L1].[Emailaddress] = @Emailaddress1) AND
            ( [LPA_L1].[LastName] = @LastName2)) OR
             ( ( ( [LPA_L1].[Postalcode] = @Postalcode3) AND 
             ( [LPA_L1].[HouseNumber] = @HouseNumber4)) AND 
             ( [LPA_L1].[LastName] = @LastName5))) AND 
             ( [LPA_L1].[CustomerId] <> @CustomerId6)))) [LPA_L1]) 
             THEN 1 ELSE 0 END AS [LPFA_1] 
        FROM [KNM].[dbo].[Klanten] [LPLA_1]


Seems to me that there's a bug in the alias names.

I tried to use Count instead Any, which worked fine btw.

Greetings.

This happens with LBLL 2.6 Final

Otis avatar
Otis
LLBLGen Pro Team
Posts: 39903
Joined: 17-Aug-2003
# Posted on: 31-Aug-2010 17:00:33   

please post the runtime library build nr and linq library build nr. See: http://www.llblgen.com/tinyforum/Messages.aspx?ThreadID=12769

i.o.w.: make sure you're using the latest build wink

Frans Bouma | Lead developer LLBLGen Pro
JMuller
User
Posts: 19
Joined: 09-Mar-2009
# Posted on: 31-Aug-2010 17:31:00   

"hides in a corner"

I did update the LinqSupportClasses.DLL, only at the wrong place rage

I was calling a webservice in a website, who was then calling a project. I updated the DLL in the project, but after updating in the website, it worked!

Sorry for bothering.