1

How can i convert this join stmnt to linq syntax

SELECT pv.Product_ID, pv.Product, v.Add_ID, v.Product_ID
  FROM Product AS pv 
  JOIN Product_Add AS v
  ON ((pv.Product_ID = v.Add_ID) OR (pv.Product_ID = v.Product_ID))
     where(( pv.Product_ID = v.Product_ID) OR (pv.product_ID = v.Add_ID))

Thanks

Pranay Rana
  • 175,020
  • 35
  • 237
  • 263
lilly
  • 11
  • 1

2 Answers2

1

I would convert this for you

but its better you use this tool which is really help full to me to convert sql to linq code

http://www.sqltolinq.com/

just download and install on your machine will do work for you.

Pranay Rana
  • 175,020
  • 35
  • 237
  • 263
0

Instead of Join, you can use from...where, it's the same thing.

from pv in Product
from v in Product_Add
where ((pv.Product_ID == v.Add_ID) || (pv.Product_ID == v.Product_ID))
     &&(( pv.Product_ID = v.Product_ID) || (pv.product_ID = v.Add_ID))

(You just AND all the join conditions with the rest of the where if you have multiple joins)

jaraics
  • 4,239
  • 3
  • 30
  • 35