In LINQ to SQL, you can access SQL Server databases just like accessing an in-memory collection by using the LINQ technology.
string connectionString = "your connection string";
using (var db = new CustomerDbDataContext(connectionString))
{
var customers = db.Customers.ToList();
foreach (var customer in customers)
{
Console.WriteLine(customer.FirstName + ", " + customer.LastName);
}
}