using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
public partial class _Default : System.Web.UI.Page
{
protected void Page_Load(object sender, EventArgs e)
{
int[] values = { 1, 2, 3, 4, 5, 6, 7, 8, 9, 0 };
var value = from v in values
where v < 3 || v > 7
orderby v descending
select v;
Response.Write("查询结果:<br>");
foreach (var i in value)
{
Response.Write(i + "<br>");
}
}
}
在LINO查询表达式中,orderby 升序用ascending关键字,降序用descending关键字
时间: 2024-12-27 20:00:43