LinqDatasource and Datapager Rocks

With small words. ASP.NET 3.5 Datapager support automatic optimized SQL paging for sql server 2000 and 2005 with LINQDatasource.

SQL 2005

SELECT COUNT(*) AS [value] FROM [Customers] AS [t0] -- Context: SqlProvider(Sql2005) Model: AttributedMetaModel Build: 3.5.21022.8 SELECT [t1].[CustomerID], [t1].[CompanyName], [t1].[ContactName], [t1].[ContactTitle], [t1].[Address], [t1].[City], [t1].[PostalCode], [t1].[Country], [t1].[Phone], [t1].[Fax] FROM ( SELECT ROW_NUMBER() OVER (ORDER BY [t0].[CustomerID], [t0].[CompanyName], [t0].[ContactName], [t0].[ContactTitle], [t0].[Address], [t0].[City], [t0].[PostalCode], [t0].[Country], [t0].[Phone], [t0].[Fax]) AS [ROW_NUMBER], [t0].[CustomerID], [t0].[CompanyName], [t0].[ContactName], [t0].[ContactTitle], [t0].[Address], [t0].[City], [t0].[PostalCode], [t0].[Country], [t0].[Phone], [t0].[Fax] FROM [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

SQL 2000

SELECT COUNT(*) AS [value] FROM [dbo].[PRODUKTE] AS [t0] -- Context: SqlProvider(Sql2000) Model: AttributedMetaModel Build: 3.5.21022.8 SELECT TOP 10 [t0].[ProduktID], [t0].[ProduktName], [t0].[ProduktVersion], [t0].[DownloadType], [t0].[DownloadURL] FROM [dbo].[PRODUKTE] AS [t0] WHERE NOT (EXISTS( SELECT NULL AS [EMPTY] FROM ( SELECT TOP 10 [t1].[ProduktID] FROM [dbo].[PRODUKTE] AS [t1] ) AS [t2] WHERE [t0].[ProduktID] = [t2].[ProduktID] )) -- Context: SqlProvider(Sql2000) Model: AttributedMetaModel Build: 3.5.21022.8

Published Thursday, January 17, 2008 11:40 AM by preishuber

Comments

No Comments

Leave a Comment

(required) 
(required) 
(optional)
(required)