My question is regarding a code sample from this MSDN article:
Getting Started (LINQ to SQL)
The following code is listed in the article:
// Northwnd inherits from System.Data.Linq.DataContext.
Northwnd nw = new Northwnd(@"northwnd.mdf");
var companyNameQuery =
from cust in nw.Customers
where cust.City == "London"
select cust.CompanyName;
foreach (var customer in companyNameQuery)
{
Console.WriteLine(customer);
}
How is "nw" created? Where does the data-type "Northwnd" come from? How am I supposed to access MY database in this way? I am writing an application that accesses a SQL server, and I have added the appropriate DBML file(s) to my project using the server explorer. But I have no idea how to write this line of code to access my DB.