I have a database written by another person with horrible table and field names. I took the advantage that LLBLGen gives me to heart and renamed them more sensibly.
So, I have a table named Ticket (which is much better than Customer_Order_Product_List_Audit), with a field named Truck_ID. I want to select the tickets and group them by Truck_ID, and so run the following query:
var coll = (from t in db.Ticket
group t by t.TruckId into grp
select grp).ToList();
and I get the following information off the exception:
"An exception was caught during the execution of a retrieval query: Invalid column name 'TruckId'.. Check InnerException, QueryExecuted and Parameters of this exception to examine the cause of this exception."
"Invalid column name 'TruckId'."
Query: SELECT [LPLA_4].[Ticket_ID] AS [TicketId], [LPLA_4].[Truck_ID] AS [TruckId], ... FROM [NRMJNL].[dbo].[Ticket] [LPLA_4] WHERE ( ( ( ( EXISTS (SELECT [LPLA_2].[TruckId] FROM [NRMJNL].[dbo].[Ticket] [LPLA_2] WHERE ( [LPLA_2].[Truck_ID] = [LPLA_4].[Truck_ID]))))))
Just wanted to let you know. I'll probably just end up going with the plain old syntax to solve this. Thanks.
Neil McGuire