Hi, I'am using Entity Framwork winform, and I'am trying to display Orders in dataGridView with department name and Roomnr and even those without Roomnr where Roomnr is null,
But shows me only those with department and RoomId is not null. How can I display even those departments with RoomId == null ?
Here is my code:
var Customerorders = (from u in db.Orders
join s in db.Employee on u.Staffid equals s.EmployeeId
join d in db.Department on u.DepartmentId equals d.DepartmentId
join r in db.Room on u.RoomId equals r.RoomId
where u.OrderNr == 1005 || u.OrderNr == 1005 && u.RoomId == null
select new
{
CheckinoutId = u.CheckInAndOutId,
CheckinDate = u.CheckInDate,
Checkout = u.CheckOutDate,
Department = d.DepartmentName,
RoomNr = r.RoomNr,
Personal = s.FirstName+" "+s.LastName
}).ToList();
if(Customerorders != null) // I Tried even with out if condition
{
dgvOrders.DataSource = Customerorders;
}
Isn't possible to display even orders without rooms? Please help