all groups > dotnet windows forms databinding > september 2007 >
You're in the

dotnet windows forms databinding

group:

DataGridView's virtual mode implementing work: It's worth it?


DataGridView's virtual mode implementing work: It's worth it? Roger Tranchez
9/7/2007 2:54:01 AM
dotnet windows forms databinding:
Hello,

I developed a multi user application for my company that handles data from a
sql server db whose main table grows little by little, every day: since 7
months after it was created, now it has around 500 records with 11 fields of
typical types: datetime, Boolean, varchar(70-225)

I understand that this is not the so called "large database", as it has
normally millions of records.

So, my first question is: with this growing rate, it is worth the work to
implement virtual mode?

My next logical question is: what would be the red line to trespass to begin
considering using that virtual mode?

And the final question involving datasets and DataGridView's virtual mode is:


I'm using strongly typed DataSets to load the data; I know this has an
overload compared to using custom objects as data sources, as long as
DataSets have a collection of methods and members associated to them for
managing the data (updating, etc), but I need them as I really use them.

I think I understand that virtual mode is used to avoid having all the data
loaded in memory for the DataGridView control, but... If I'm using a DataSet,
the whole data is already in that DataSet, so ALL the data is already in
memory, isn't it ?

That would mean that if I DON'T use virtual mode the data would be REPEATED
in computer's memory? (once for the DataSet, once for the DataGrid's internal
management)?!

If this is true (I'm starting to CREEP around 8-d), for really make the most
of the computer's memory I would have to use "partial load" methods to
populate the datasets?

It sounds too complex, but I'm ready to hear your answers, being them easy
or not.

Thanks in advance,


Roger Tranchez
MCTS
RE: DataGridView's virtual mode implementing work: It's worth it? v-lliu NO[at]SPAM online.microsoft.com
9/10/2007 12:00:00 AM
Hi Roger,

[quoted text, click to view]

IMO, it may be not worth the work to implement virtual mode with this
growing rate.

[quoted text, click to view]
virtual mode?

Well, MSDN documents don't explicitly state the red line to begin
considering using the virtual mode, instead only recommend to implement
virtual mode in the DataGridView control if you are working with a very
large table in a database. I think if the row count in a table in database
is more than ten thousand, you could consider using virtual mode.

[quoted text, click to view]
so ALL the data is already in memory, isn't it ?

No. If we implement virtual mode in a DataGridView, we don't fill ALL the
data into the DataSet and then bind the DataGridView to the data source.
Instead, we retrieve only as much data from a database as is necessary for
optimal performance.

[quoted text, click to view]
REPEATED in computer's memory? (once for the DataSet, once for the
DataGrid's internal management)?!

If you don't use virtual mode, you can use SqlDataAdapter or TableAdapter
to fill all the data from a table in database into a DataTable and set the
DataSource property of the DataGridView control to the DataTable. The
DataGridView automatically loads the data from the specified source and
submits user changes back to it.

[quoted text, click to view]
most of the computer's memory I would have to use "partial load" methods to
populate the datasets?

If you're working with large amounts of data over a slow network connection
or with client machines that have a limited amount of RAM or storage space,
you can cosider implementing virtual mode in the DataGridView.

For more information on how to implement virtual mode in a DataGridView ,
you may refer to the following MSDN documents:

'Implementing Virtual Mode with Just-In-Time Data Loading in the Windows
Forms DataGridView Control'
http://msdn2.microsoft.com/en-us/library/ms171624.aspx

'Walkthrough: Implementing Virtual Mode in the Windows Forms DataGridView
Control'
http://msdn2.microsoft.com/en-us/library/15a31akc.aspx

'Performance Tuning in the Windows Forms DataGridView Control'
http://msdn2.microsoft.com/en-us/library/ms171621.aspx

Hope this helps.
If you have any question, please feel free to let me know.

Sincerely,
Linda Liu
Microsoft Online Community Support

==================================================
Get notification to my posts through email? Please refer to
http://msdn.microsoft.com/subscriptions/managednewsgroups/default.aspx#notif
ications.

Note: The MSDN Managed Newsgroup support offering is for non-urgent issues
where an initial response from the community or a Microsoft Support
Engineer within 1 business day is acceptable. Please note that each follow
up response may take approximately 2 business days as the support
professional working with you may need further investigation to reach the
most efficient resolution. The offering is not appropriate for situations
that require urgent, real-time or phone-based interactions or complex
project analysis and dump analysis issues. Issues of this nature are best
handled working with a dedicated Microsoft Support Engineer by contacting
Microsoft Customer Support Services (CSS) at
http://msdn.microsoft.com/subscriptions/support/default.aspx.
==================================================

This posting is provided "AS IS" with no warranties, and confers no rights.
RE: DataGridView's virtual mode implementing work: It's worth it? v-lliu NO[at]SPAM online.microsoft.com
9/12/2007 10:48:28 AM
Hi Roger,

How about the problem now?

If you have any question, please feel free to let me know.

Thank you for using our MSDN Managed Newsgroup Support Service!

Sincerely,
Linda Liu
Microsoft Online Community Support
AddThis Social Bookmark Button