pattern for displaying tabular data

  • Thread starter Thread starter t
  • Start date Start date
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.
 
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
 
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 :)
 
Back
Top