Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
HomeAnnouncementsFree MagazinesWhite PapersSubmit Content
Discussion GroupsASP.NETWindows FormsLanguages.NET FrameworkVisual Studio.NET
Articles.NET FrameworkASP.NETToolsWindows Forms
.NET DirectoryOpen Source ProjectsUser GroupsWeb Resources
Related Topics
Visual Basic 6SQL ServerMS AccessOther DB ProductsMS Server ProductsMore Topics ...

.NET Forum / Windows Forms / WinForm Data Binding / September 2007

Tip: Looking for answers? Try searching our database.

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

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
Roger Tranchez - 07 Sep 2007 10:54 GMT
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
.NET 2005 and DB developer
Linda Liu [MSFT] - 10 Sep 2007 06:03 GMT
Hi Roger,

> with this growing rate, it is worth the work to implement virtual mode?

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

> what would be the red line to trespass to begin considering using that
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.

> 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 ?

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.

> 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 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.

> 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?

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.
Linda Liu [MSFT] - 12 Sep 2007 11:48 GMT
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

Free Magazines

Get these publications absolutely FREE for up to 12 months. There are no hidden fees and no obligation. Simply choose a title, complete the application form and submit it. Read more ...

Oracle MagazineNetwork ComputingComputer WorldBio-IT WorldeWeekInformation WeekInfosecurity
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.