点击按钮,我正在写这个:
protected void Button1_Click(object sender, EventArgs e)
{
List<Students> student = new List<Students>()
{
new Students {FirstName= "Ram", LastName= "Gol"},
new Students {FirstName= "Ran", LastName= "Gom"},
new Students {FirstName= "Rao", LastName= "Gon"},
new Students {FirstName= "Rap", LastName= "Goo"}
};
IEnumerable<Students> empQuery = from s in student
where s.FirstName.Length ==3
select s.FirstName;
foreach (var stud in empQuery)
{
Button1.Text = stud;
}
我也在使用System.Collection.Generic。但是我收到错误的
找不到类型或命名空间名称'Students'(是你吗? 缺少using指令或程序集引用?)
请让我知道我做错了什么。
答案 0 :(得分:3)