Click here to Skip to main content
15,892,298 members
Articles / Database Development / SQL Server

Paging and Sorting on SQL Server and Oracle using Sql.Net

Rate me:
Please Sign up or sign in to vote.
4.79/5 (10 votes)
21 Feb 20055 min read 93.9K   742   36  
This article presents an alternative solution to paging large datasets using Open Source Sql.Net library.
create database sqlom;

use "sqlom";

/*
Table structure for customers
*/

CREATE TABLE "customers" (
  "customerId" int NOT NULL default 0,
  "name" char(255) default NULL,
  "birthDate" datetime default NULL,
  PRIMARY KEY  ("customerId")
) 

/*
Table data for sqlom.customers
*/

INSERT INTO "customers" VALUES (1,'John','1979-06-09 00:00:00')
INSERT INTO "customers" VALUES (2,'Mark','1978-01-02 11:54:00')
INSERT INTO "customers" VALUES (3,'Lucinda','1952-12-01 00:00:00')

/*
Table structure for orders
*/

CREATE TABLE "orders" (
  "orderId" int NOT NULL default 0,
  "productId" int default NULL,
  "customerId" int default NULL,
  "date" datetime default NULL,
  "quantaty" int default NULL,
  PRIMARY KEY  ("orderId")
)

/*
Table data for sqlom.orders
*/

INSERT INTO "orders" VALUES (1,1,1,'2004-12-30 00:00:00',12)
INSERT INTO "orders" VALUES (2,1,2,'2004-12-31 00:00:00',2)
INSERT INTO "orders" VALUES (3,2,2,'2004-12-15 00:00:00',80)

/*
Table structure for products
*/

CREATE TABLE "products" (
  "productId" int NOT NULL default 0,
  "price" float default NULL,
  "name" varchar(255) default NULL,
  "quantaty" int default NULL,
  PRIMARY KEY  ("productId")
)

/*
Table data for sqlom.products
*/

INSERT INTO "products" VALUES (1,99.9,'Skrewdriver',200)
INSERT INTO "products" VALUES (2,15.4,'Hamer',180)
INSERT INTO "products" VALUES (3,1,'Nail',1000)



By viewing downloads associated with this article you agree to the Terms of Service and the article's licence.

If a file you wish to view isn't highlighted, and is a text file (not binary), please let us know and we'll add colourisation support for it.

License

This article has no explicit license attached to it but may contain usage terms in the article text or the download files themselves. If in doubt please contact the author via the discussion board below.

A list of licenses authors might use can be found here


Written By
United States United States
This member has not yet provided a Biography. Assume it's interesting and varied, and probably something to do with programming.

Comments and Discussions