Thursday, March 29, 2012

Paging question

Hello all:

Suppose I have a datagrid and when I retrieve a datatable, and flake a
dataview off of that table to bind to my grid, my datatable has, say,
10,000+ records in it.
Suppose further that my datagrid has paging turned on, and I display 10
rows of data at a time.
Let us further suppose that I am caching the table in the page cache,
and retrieving it at datagrid binding time:

myDataView = New DataView(CType(Cache.Item("myDataTable"),DataTable)
myDataGrid.DataSource = myDataView
myDataGrid.DataBind()

Given that my datagrid will display only 10 rows at a time -
1) How many rows are in my dataview? All of them, or just the 10 being
displayed in the datagrid?
2) Where in memory is my datatable - on the server, or on the client?

I'm trying to figure out if I have a bandwidth issue whether I allow
the grid to display all of the rows, or if I page it...

Thanks much,
zdrakec> Given that my datagrid will display only 10 rows at a time -
> 1) How many rows are in my dataview? All of them, or just the 10 being
> displayed in the datagrid?

DataViews don't "hold" any data at all, they are just filters of the
original data in your DataTable.

> 2) Where in memory is my datatable - on the server, or on the client?

All of your object instances are always held in memory on the server that
created them.

> I'm trying to figure out if I have a bandwidth issue whether I allow
> the grid to display all of the rows, or if I page it...

You may want to consider pulling down just 10 records from your database at
a time and make more trips to the data store than pulling down all of them
and not going back to the data store again.

> Thanks much,
> zdrakec
Hello Scott:

Ya know, I knew that about dataviews, so I must be getting senile :)

I'm wondering, not so much about holding that big a recordset on the
server memory, but how much of that data is actually being sent via my
network back to the client...all of it, or just the 10 records I have
my grid display at a time?

Thank you,
zdrakec
All of it is being sent to the client, regardless of how many records you
opt to show at any one time. This is why I suggest getting the records in
smaller batches and more often.

"zdrakec" <zdrakec@.yahoo.com> wrote in message
news:1121808311.966023.57210@.z14g2000cwz.googlegro ups.com...
> Hello Scott:
> Ya know, I knew that about dataviews, so I must be getting senile :)
> I'm wondering, not so much about holding that big a recordset on the
> server memory, but how much of that data is actually being sent via my
> network back to the client...all of it, or just the 10 records I have
> my grid display at a time?
> Thank you,
> zdrakec
That's what I figured, but I wasn't sure. Yes, I may well have to fetch
smaller batches...

Thanks for the info!

Cheers,
zdrakec

0 comments:

Post a Comment