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