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>");
}
}
}

 

asp.net LINQ数据访问技术from where select  order by子句

在LINO查询表达式中,orderby 升序用ascending关键字,降序用descending关键字

 

相关文章:

  • 2021-08-05
  • 2022-12-23
  • 2022-12-23
  • 2021-06-14
  • 2022-12-23
  • 2022-01-19
  • 2022-12-23
  • 2021-03-30
猜你喜欢
  • 2021-05-20
  • 2021-06-02
  • 2022-12-23
  • 2021-12-30
  • 2022-02-25
  • 2021-11-17
相关资源
相似解决方案