这个例子在madn上,写在这里纯属练字,需要System.Data.Linq;
1
static void doSomething()
2
{
3
Table<Customer> Customers = db.GetTable<Customers>();
4
IQueryable<string> custNameQuery = from cust in Customers
5
where cust.City = "Fuzhou"
6
select cust.Name;
7
foreach (string name in custNameQuery)
8
{
9
Console.WriteLine("the name is {0}", name);
10
}
11
}
static void doSomething()2
{3
Table<Customer> Customers = db.GetTable<Customers>();4
IQueryable<string> custNameQuery = from cust in Customers5
where cust.City = "Fuzhou"6
select cust.Name;7
foreach (string name in custNameQuery)8
{9
Console.WriteLine("the name is {0}", name);10
}11
}

posted on
浙公网安备 33010602011771号