定义了
var companyNameQuery = (
from cust in nw.Customers
select cust
).Skip(0).Take(20);
TextBox2.Text = companyNameQuery.ElementAt(0).City; //这里如果在上边的定义上不加ToList()就报错,有没有不需要ToList就能获取指定记录中某个字段的值的方法?
var companyNameQuery = (
from cust in nw.Customers
select cust
).Skip(0).Take(20);
TextBox2.Text = companyNameQuery.ElementAt(0).City; //这里如果在上边的定义上不加ToList()就报错,有没有不需要ToList就能获取指定记录中某个字段的值的方法?
而你的文本框是string类型,所以要进行转换~!