EDITED: I am retrieving some order data and am trying to grab the product description from another table using the productID from the first table. The code below works fine but I need to query the products table using the productid to get the string,product description
Dim result = From c In ctx.orders
Where c.CustomerId = 13
Select New With
{c.OrderDate,
c.PurchaseOrderNumber,
c.ProductId,
c.ProductPrice,
c.ProductQty}
I tried the suggestions below and get a “field or property named productid doesnt exist” error
using this method
Dim result = From c In ctx.orders
Where c.CustomerId = 13
Join prod In ctx.products on c.ProductId Equals prod.Id
Select New With
{c.OrderDate,
c.PurchaseOrderNumber,
prod.Description,
c.ProductPrice,
c.ProductQty}
Why not use the join operator C# version and join operator VB version
I made a sample class to test the join and this worked perfectly. Are you sure it loaded the products tables and it has the property?