A few small examples of linq and a small example of linq
Private void button#click (object sender, EventArgs e) {int [] numbers = new int [7] {0, 1, 2, 3, 4, 5, 6 }; var result0 = from num in numbers where (num % 2 = 0) select num; foreach (int n in result0) {listBox1.Items. add (n) ;}} private void button2_Click (object sender, EventArgs e) {listBox1.Items. clear (); int [] numbers = new int [7] {2, 3, 4, 3, 5 }; var result1 = from num in numbers where num> 3 orderby num descending select num; foreach (int n in result1) {listBox1.Items. add (n) ;}} private void button3_Click (object sender, EventArgs e) {listBox1.Items. clear (); int [] numbers = new int [7] {2, 3, 2, 4, 3, 5, 5 }; var result2 = from num in numbers where num> 3 orderby num ascending select string. format ("Current Value: {0}", num); foreach (string n in result2) {listBox1.Items. add (n) ;}} private void button4_Click (object sender, EventArgs e) {listBox1.Items. clear (); int [] numbers = new int [7] {2, 3, 2, 4, 3, 5, 5 }; int result3 = (from num in numbers where num> 3 select num ). count (); button4.Text + = "--" + result3.ToString ();}