static void Main(string[] args) { using (var db = new CustomerDBDataContext(@"DataSource=.;Initial Catalog=northwind;Intergrated Security=True")) { var customers = db.Customers().ToList(); foreach (var x in customers) { Console.WriteLine(x.CompanyName); } } }