Wednesday, March 7, 2012

Question on displaying large number of record?

I have datagrid that needs to display a log table which has more than million records.

Since it it huge number, it is not possible to get dataset using "select * from log_table" to fill and to bind to datagrid.

Is there anyway to display first 100 rows on first page and show next 100 rows if use clicks on page 2?

Thank you very much in advance!

Justin

since its simply not feasible to bring that much data back from sql, you should look at performing the paging logic in sql server itself.
sql would only return one page of data at a time

here's some links to see how it can be done:

http://weblogs.asp.net/pwilson/archive/2003/10/10/31456.aspx

http://www.sqlmag.com/articles/index.cfm?articleid=40505

http://www.4guysfromrolla.com/webtech/062899-1.shtml

i'm sure there are plenty more examples floating around..

|||

You could use the TOP clause in your query

or

You could use .net assemblies with SQL server......(CREATE ASSEMBLY ...)

|||I am using Oracle but thank you anyway... I got idea...

|||

In PL/SQL you can use row_number() function, or if you don't need to sort the records, simply use the ROWNUM column.

No comments:

Post a Comment