using System;
using System.Linq;
using System.IO;
using System.Collections.Generic;
namespace ConsoleApplication1
{
class Program
{
static void Main(string[ args)
{
using (DataClasses1DataContext dataContext = new DataClasses1DataContext())
{
StreamWriter sw = new StreamWriter(@"d:\log.txt");
sw.AutoFlush = true;
TextWriter tw = TextWriter.Synchronized(sw);
dataContext.Log = tw;
var r = dataContext.Table_1.Where(t => t.ID > 3).OrderByDescending(t => t.ID).Take(5);
r.ToList().ForEach(delegate(Table_1 t) {
Console.WriteLine("{0}:{1}", t.ID, t.Number);
});
}
Console.ReadLine();
}
}
}