Hi,
This query works:
var q = from o in dbContext.OrderDetails
let c = o.Customer
let cc = c.CustomerCat
select new
{
cc.Description
};
var res = q.ToList();
and generates the SQL:
SELECT t3.Description AS Description
FROM "OrderDetail" t1
INNER JOIN "Customer" t2 ON t1.CustomerId = t2.Id
INNER JOIN "CustomerCat" t3 ON t2.CustomerCatId = t3.Id
However, this query fails:
var q = from o in dbContext.OrderDetails
select new
{
o.Customer.CustomerCat.Description
};
It generates the SQL:
SELECT t3.Description AS Description
FROM "OrderDetail" t1
INNER JOIN ("Customer" t2
INNER JOIN "CustomerCat" t3 ON t2.CustomerCatId = t3.Id) ON t1.CustomerId = t2.Id
which fails with
Devart.Data.SQLite.SQLiteException
HResult=-2146233088
Message=SQLite error
no such column: t3.Description
Invalid SQL generated LinqConnect for Metro
Re: Invalid SQL generated LinqConnect for Metro
Thank you for the report on this. We have reproduced this issue. We will investigate it and inform you about the results as soon as possible.
Re: Invalid SQL generated LinqConnect for Metro
The bug with silent/verysilent uninstall with the NOFEEDBACK option is fixed.
______________________
https://littlelioness.net/
click here
https://littlelioness.net/2020/10/30/office-christmas-party/
______________________
https://littlelioness.net/
click here
https://littlelioness.net/2020/10/30/office-christmas-party/
Last edited by henn9438 on Wed 04 Nov 2020 06:12, edited 3 times in total.
Re: Invalid SQL generated LinqConnect for Metro
Have you made any progress on this?MariiaI wrote:Thank you for the report on this. We have reproduced this issue. We will investigate it and inform you about the results as soon as possible.
Re: Invalid SQL generated LinqConnect for Metro
This is a bug in the CSharpSQLite engine, which cannot execute the SQL generated by LinqConnect for Metro. The fix for the issue will take some time, because we will contact the developers of the CSharpSQLite engine and wait for a reply from them. We will contact you when any results are available.
As a workaround, please use JOINs explicitly, e.g.:
Or as you have written in your first post:
As a workaround, please use JOINs explicitly, e.g.:
Code: Select all
var q = from o in db.OrderDetails
join od in db.Orders on o.OrderID equals od.OrderID
join c in db.Customers on od.CustomerID equals c.CustomerID
select new
{
c.Address
};
Code: Select all
var q = from o in dbContext.OrderDetails
let c = o.Customer
let cc = c.CustomerCat
select new
{
cc.Description
};