IEnumerable_Join_Query1
Code :

using System;
using System.Data;
using System.Linq;
using System.Collections.Generic;

//csc IEnumerable_Join_Query1.cs
namespace ConsoleApplication1
{


class MainClass
{

public static void Main(string[] args)
{

Int32[] ArrayA = { 1, 2, 3, 4, 8 };
Int32[] ArrayB = { 1, 5, 3, 8, 7 };

// Create the query.
var intJoined = from QueryA in ArrayA join QueryB in ArrayB on QueryA equals QueryB select new { QueryA, QueryB };
IEnumerable<Int32> intSerial = (from intEnumA in ArrayB select intEnumA);
IEnumerable<Int32> intEnum = (from intEnumA in ArrayB.AsEnumerable() orderby intEnumA ascending select intEnumA);
var intArray = from n1 in ArrayB.AsEnumerable() orderby n1 descending select n1;

// Display the results.
Console.WriteLine("Join Queries Array1 Array2 ");
string str1 ;
foreach (var ThisValue in intJoined)
{
str1 = ThisValue.QueryA.ToString() ;
str1 += " Matched ";
str1 +=ThisValue.QueryB.ToString() ;
Console.WriteLine(str1);
//This is from an anonymous query to verify use the string below
// L1.Text = L1.Text + ThisValue.GetType() + "&nbsp &nbsp Matched = &nbsp &nbsp" +
// ThisValue.QueryB.ToString() + "");
}
Console.WriteLine("-Using IEnumerable<Int32> Serialize--- ");
foreach (var ThisValue in intSerial)
{
if (ThisValue < intSerial.Last())
{ Console.Write( ThisValue.ToString() + ","); }
else
{
Console.Write(" " + ThisValue.ToString());
}
}
Console.WriteLine();
Console.WriteLine("--Using IEnumerable<Int32> Ascending ----- ");
foreach (var ThisValue in intEnum)
{
if (ThisValue < 8)
{ Console.Write(" " + ThisValue.ToString() + ","); }
else
{
Console.Write(" " + ThisValue.ToString());
}
}
Console.WriteLine();
Console.WriteLine("-using var<Int32> descending ---- ");
foreach (var ThisValue in intArray)
{
if (ThisValue > 1)
{ Console.Write("" + ThisValue.ToString() + ","); }
else
{
Console.Write(" " + ThisValue.ToString());
}
}

//
Console.ReadLine();

}
}
}