LINQ Query

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
 
S

sloan

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 ?
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Similar Threads

LINQ Join Error 1
linq to object query 2
Linq. Count records 0
LINQ related query 7
Data binding with linq query 0
linq to object query 1
LINQ - Need Advice 1
Linq to entites 13

Members online

No members online now.

Forum statistics

Threads
473,768
Messages
2,569,574
Members
45,051
Latest member
CarleyMcCr

Latest Threads

Top