Question: Why lines 5 and 6 giving me trouble?
How can I fix this. I have used this sort of syntax for years in SQL work. What is the equivalent in LINQ (vb.net)?
Dim ODs = (From od In db.tblOrderDetails Join o In _
db.tblOrders On od.OrderID Equals o.OrderID Join c In _
db.tblCustomers On o.CustomerID Equals c.CustomerID Join s In _
db.tblSoftwares On od.SoftwareID Equals s.SoftwareID _
Where o.OrderID = IIf(intOrderID = 0, o.OrderID, intOrderID) And _
o.CustomerID = IIf(intCustID = 0, o.CustomerID, intCustID) _
Order By c.FirstName & " " & c.LastName _
Select CustName = c.FirstName & " " & c.LastName, _
od.OrderID, o.OrderDate, s.Title, od.Quantity, s.UnitPrice, Sub_Total = od.Quantity * s.UnitPrice).ToArray()
Please see: http://developwith.net/2012/07/20/where-if-and-where-iif-linq/
if it could help. I may need some help in its implementation.