using System;using System.Collections.Generic;using System.Linq; class Program{ static void Main(string[] args) { var nums = GetAllNumber(); //var nums = GetAllNumber().ToList(); var t = nums.Skip(100000).Take(2000).Where(x => x % 7 == 0); foreach(int i in t) { Console.Write("{0}\t", i.ToString()); } } static IEnumerable GetAllNumber() { for (int i = 0;i database = //获取数据源; foreach (T info in database) { DataRow row = dt.NewRow(); row["ID"] = database.ID; row["Name"] = database.Name; table.Rows.Add(row); } } return table;ObjectQuery ToTraceString()DECLARE @pageSize INT ;DECLARE @pageIndex INT ;SET @pageSize = 5SET @pageIndex =2 ; --第二页,每页显示5条数据 SELECT *FROM ( SELECT ROW_NUMBER() OVER ( ORDER BY CreateDate ASC ) AS 'rowNumber' , * FROM dbo.Task_Info ) AS tempWHERE rowNumber BETWEEN ( ( ( @pageIndex - 1 ) * @pageSize ) + 1 ) AND ( @pageIndex * @pageSize ) public static string ToTraceString (this IQueryable query) { return ((System.Data.Objects.ObjectQuery) query).ToTraceString(); } //调用 query.ToTraceString();