471,310 Members | 1,364 Online
Bytes | Software Development & Data Engineering Community
Post +

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 471,310 software developers and data experts.

LINQ 101 syntax error

Can anybody tell me how to fix this method from the MS linq examples?

public void Linq14() {
int[] numbersA = { 0, 2, 4, 5, 6, 8, 9 };
int[] numbersB = { 1, 3, 5, 7, 8 };

var pairs =
from a in numbersA,
b in numbersB
where a < b
select new {a, b};

Console.WriteLine("Pairs where a < b:");
foreach (var pair in pairs) {
Console.WriteLine("{0} is less than {1}", pair.a, pair.b);
}
}

*** Sent via Developersdex http://www.developersdex.com ***
Aug 12 '08 #1
1 1008
from a in numbersA
from b in numbersB

the rest unchanged
Aug 12 '08 #2

This discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

28 posts views Thread by Marc Gravell | last post: by
4 posts views Thread by shapper | last post: by
7 posts views Thread by Andy B | last post: by
9 posts views Thread by Cirene | last post: by
4 posts views Thread by =?Utf-8?B?TWlrZSBDb2xsaW5z?= | last post: by
21 posts views Thread by hrishy | last post: by
1 post views Thread by hrishy | last post: by
4 posts views Thread by CSharper | last post: by

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.