By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
454,424 Members | 1,375 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 454,424 IT Pros & Developers. It's quick & easy.

Linq. Where versus On

P: n/a
Hello,

What is the difference between using:

from a in A
join b in B on a.Name equals b.Name
select a;

and:

from a in A
join b in B where a.Name equals b.Name
select a;

I was using "on" but on this group Jon suggested me the Where example.

Shouldn't I use the "on" in Joins and "where" when I want to impose
some condition to filter items on a condition?

Thanks,
Miguel
Jul 3 '08 #1
Share this Question
Share on Google+
1 Reply


P: n/a
shapper <md*****@gmail.comwrote:
What is the difference between using:

from a in A
join b in B on a.Name equals b.Name
select a;

and:

from a in A
join b in B where a.Name equals b.Name
select a;
The first is valid, the second isn't.
I was using "on" but on this group Jon suggested me the Where example.
Just a typo in a hastily written post, I'm afraid.
Shouldn't I use the "on" in Joins and "where" when I want to impose
some condition to filter items on a condition?
Yes.

--
Jon Skeet - <sk***@pobox.com>
Web site: http://www.pobox.com/~skeet
Blog: http://www.msmvps.com/jon_skeet
C# in Depth: http://csharpindepth.com
Jul 3 '08 #2

This discussion thread is closed

Replies have been disabled for this discussion.