I am using Crystal Report for creating a report. I have two tables, Driver_Specifications
and WatchRow
.
Primary key of WatchRow
is foreign key of Driver_Specifications
. I set some field in my report file to show the data of Driver_Specifications
and I want to show a specific field of WatchRow
instead of the foreign key of Driver_Specifications
. What is the query of LINQ for this problem?
This is what I have so far:
var q = (from d in taxi_AgencyDataSet.Driver_Specifications
orderby d.First_Name, d.ID_Driver
select new
{
d.First_Name,
d.Last_Name,
d.Car_Name,
d.Car_Color,
d.WatchRow.Watch_Name,
d.ID_Watch
}).ToList();
I get the following error:
Object reference not set to an instance of an object