Question

I'm trying to determine the best approach for performing paging.

I have two options of grabbing data using SubSonic:

1) itemDatumCollection.LoadAndCloseReader(sp.GetReader()); or 2) itemsDataSet = sp.GetDataSet();

With both I am accessing the same stored procedure. Is there a simple way of paging with LoadAndCloasReader()?

I could load all the data through GetDataSet on the client - say 4000 rows, but seems unnecessary, and this amount of data exceeds my WCF binding parameters (which I think are set pretty good) when I use LoadAndCloseReader() as it returns a complex object:

maxBufferSize="20000000" maxBufferPoolSize="524288" maxReceivedMessageSize="20000000"

So a couple of things I guess:

1) Is GetDataSet() faster at returning data - I don't need the complex collection object (it's just nice when coding)?

2) How can I perform paging using my TSQL sproc?

Thanks.

Was it helpful?

Solution

I went with an approach used more in MVVM, rather than MVC. I loaded all the data up front, then allowed the user to page through it using a jQuery paging control, there-by minimizing return calls to the database. The initial response takes a bit longer (but is limited to 100 records), but provides the user with lightening-fast paging.

I used the Simple Pager jQuery plugin.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top