pattern for displaying tabular data

T

t

Hi,

I have the following problem. The web-based software I am to create is going
to display tabular data. Lots of data so I need some pagging mechanism. I
thought about creating three classes: GridView (displayng tabular data),
PaggingControl (displaying [Previous] and [Next] buttons) and DataSource (for
retrieving data from the db. In the database I have following data:

id | column1 | column2
-------------------------------------
1 | data11 | data 12
2 | data21 | data 22
(...)

DataSource class retrieves data basing on three parameters: id, pagesize,
direction. For example DataSource(30, 10, Back) gets records with id 20, 21,
..., 29.

The question is: are there design patterns describing such a problem. Any
solutions you'd recommend?

T.
 
G

Guest

t said:
The question is: are there design patterns describing such a problem. Any
solutions you'd recommend?

Anything wrong with using a DataGrid or Data List?
 
J

Jeff

This link will help with your DataClass (accomplishing what you describe is
easier said than done... this article gives you options)
http://www.aspfaq.com/show.asp?id=2120
If you are using SQL Server 2005, you have additional options; check with
the SQL Server NG for those.

Otherwise I'm not sure about a specific or well-known pattern of which you
ask.

-HTH
 
P

Pier Paolo

t said:
Hi,

I have the following problem. The web-based software I am to create is going
to display tabular data. Lots of data so I need some pagging mechanism. I
thought about creating three classes: GridView (displayng tabular data),
PaggingControl (displaying [Previous] and [Next] buttons) and DataSource (for
retrieving data from the db. In the database I have following data:

id | column1 | column2
-------------------------------------
1 | data11 | data 12
2 | data21 | data 22
(...)

DataSource class retrieves data basing on three parameters: id, pagesize,
direction. For example DataSource(30, 10, Back) gets records with id 20, 21,
.., 29.

The question is: are there design patterns describing such a problem. Any
solutions you'd recommend?
In my opinion it depends on how much rows you have to extract. You can
not think to make every time a query (if tables are big) to get the next
recordset, it is more efficient for DB (I am a dba but i like to
develop) if you get all the recordset and then paged it. You can do it
mantainging it in session or directly in javascripts ....I'd look at
technologies like AJAX so you put the work on the browser ....(if you
dont have dialup visitors :)
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,755
Messages
2,569,535
Members
45,007
Latest member
obedient dusk

Latest Threads

Top