using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
namespace ConsoleApplication19
{
class Program
{
static void Main(string[] args)
{
NorthwindDataContext context = new NorthwindDataContext();
context.Log = Console.Out;
int page = 2;
var result = (from s1 in context.Customers
orderby s1.CustomerID select s1).Skip(page * 10).Take(10);
foreach (var item in result)
Console.WriteLine(item.CustomerID);
Console.ReadLine();
}
}
}
|
SELECT [t1].[CustomerID], [t1].[CompanyName], [t1].[ContactName], [t1].[ContactT
itle], [t1].[Address], [t1].[City], [t1].[Region], [t1].[PostalCode], [t1].[Coun
try], [t1].[Phone], [t1].[Fax], [t1].[NOTES], [t1].[TEST_ID]
FROM (
SELECT ROW_NUMBER() OVER (ORDER BY [t0].[CustomerID]) AS [ROW_NUMBER], [t0].
[CustomerID], [t0].[CompanyName], [t0].[ContactName], [t0].[ContactTitle], [t0].
[Address], [t0].[City], [t0].[Region], [t0].[PostalCode], [t0].[Country], [t0].[
Phone], [t0].[Fax], [t0].[NOTES], [t0].[TEST_ID]
FROM [dbo].[Customers] AS [t0]
) AS [t1]
WHERE [t1].[ROW_NUMBER] BETWEEN @p0 + 1 AND @p0 + @p1
ORDER BY [t1].[ROW_NUMBER]
-- @p0: Input Int (Size = 0; Prec = 0; Scale = 0) [20]
-- @p1: Input Int (Size = 0; Prec = 0; Scale = 0) [10]
-- Context: SqlProvider(Sql2005) Model: AttributedMetaModel Build: 3.5.21022.8
EASTC
ERNSH
FAMIA
FISSA
FOLIG
FOLKO
FRANK
FRANR
FRANS
FURIB
|