点击按钮,我正在写这个:
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。但是我遇到了错误
找不到类型或命名空间名称“学生”(您是否缺少 using 指令或程序集引用?)
请让我知道我做错了什么。