I am trying to get into LINQ. I have created ConsoleApplicat ion
project and have pasted in the code from one of the examples in help:
DataContext db = new DataContext(@"c :\program files
\microsoft sql server\mssql\da ta\northwnd.mdf ");
Table<CustomerC ustomers = db.GetTable<Cus tomer>();
var query = from cust in Customers where cust.City ==
"London" select cust;
foreach (var cust in query)
Console.WriteLi ne(string.Forma t("id = {0}, City =
{1}", cust.CustomerID , cust.City));
But the compiler barfs on the second line. Apparently, the Customer
object is a "typed table". The example does not tell you how to create
this typed table.
I have searched help and cannot find any direction. Can someone point
me in the right direction?
project and have pasted in the code from one of the examples in help:
DataContext db = new DataContext(@"c :\program files
\microsoft sql server\mssql\da ta\northwnd.mdf ");
Table<CustomerC ustomers = db.GetTable<Cus tomer>();
var query = from cust in Customers where cust.City ==
"London" select cust;
foreach (var cust in query)
Console.WriteLi ne(string.Forma t("id = {0}, City =
{1}", cust.CustomerID , cust.City));
But the compiler barfs on the second line. Apparently, the Customer
object is a "typed table". The example does not tell you how to create
this typed table.
I have searched help and cannot find any direction. Can someone point
me in the right direction?
Comment