LINQ Query

  • Thread starter Thread starter shapper
  • Start date Start date
S

shapper

Hello,

I have 2 tables:
[A] > Aid, Aname ...
> Bid, Aid, Bname ...

I need to get the records in B given a Bname and a Aname. I think I
should use Inner Join.

I wrote the following code:

Dim Bs = From a In db.A _
Join b In db.B _
On a.Aid Equals b.Aid _
Where a.Aname = AName And b.Bname = BName

This is not working.
What am I doing wrong?
And is there Inner Join in LINQ?

Thanks,
Miguel
 
int myOrderID = 10; // bad naming convention on purpose

then some linq

from o in db.Orders
join od in db.OrderDetails
on o.OrderID equals od.OrderID
where o.OrderID > myOrderID



I don't know. C# code above, but yours looks right.

You may need to show more code.

What is your AName and BName ?
 
Back
Top