protected void Page_Load(object sender, EventArgs e)
{
string[] cities = { "London", "Amsterdam", "San Francisco", "Las Vegas",
& nbsp; "Boston", "Raleigh", "Chicago", "Charlestown",
& nbsp; "Helsinki", "Nice", "Dublin" };
GridView1.DataSource = from city in cities
& nbsp; where city.Length > 4
& nbsp; orderby city
& nbsp; select city.ToUpper();
GridView1.DataBind();
}
}
linq hello world
最新推荐文章于 2026-05-31 12:13:23 发布
本文介绍了一个简单的C#程序实例,该程序使用LINQ从一个包含多个城市名称的数组中筛选出长度大于4的城市名,并将其转换为大写形式后显示在GridView中。
888

被折叠的 条评论
为什么被折叠?



