473,396 Members | 1,784 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,396 software developers and data experts.

DataGridView + DataTable Speed

Hello,
When I create a DataTable and add 10000 rows my computer needs about
20ms. To delete 10000 rows it needs about 15ms.

When I connect the DataTable to a DataGridView it needs 3100ms to add
10000 rows and 6300ms to delete 10000 rows. That might be ok because
the control needs an update.

But when a disconnect the DataTable widht dgv.DataSoure = null it
needs 420ms to add 10000 rows and 2430ms to delete rows.

Can anyone explain what happened here and how I can modify the
DataTable so I get the performance when it is never bound to a
DataGridView?

Thanks in advance for any response

Azraiyl
Jan 14 '08 #1
3 5800
Well, how did you bind it to the dgv? Was there a BindingSource
involved? Either way, controls (such as dgv) generally also speak to a
CurrencyManager via their BindingContext, so it is quite possible that
until you kill the form, that the ctx is still talking to the form
[but without any UI to redraw any more, hence not as slow]; the
BindingContext keeps a reference to the source as currency is shared
between alike sources.

Marc
Jan 14 '08 #2
Hi,

You need to provide more details, like if this is a win or a web based app.
In any case 10K of rows are a little too much, you should reduce the number
of rows. That will improve the performance al ot.

--
Ignacio Machin
http://www.laceupsolutions.com
Mobile & warehouse Solutions.
<az*****@gmail.comwrote in message
news:4e**********************************@i29g2000 prf.googlegroups.com...
Hello,
When I create a DataTable and add 10000 rows my computer needs about
20ms. To delete 10000 rows it needs about 15ms.

When I connect the DataTable to a DataGridView it needs 3100ms to add
10000 rows and 6300ms to delete 10000 rows. That might be ok because
the control needs an update.

But when a disconnect the DataTable widht dgv.DataSoure = null it
needs 420ms to add 10000 rows and 2430ms to delete rows.

Can anyone explain what happened here and how I can modify the
DataTable so I get the performance when it is never bound to a
DataGridView?

Thanks in advance for any response

Azraiyl

Jan 14 '08 #3
@Marc Gravell

I did bind it with "dgv.DataSource = dt". Thanks for your information
about this CurrencyManager, have first to google about it.

@Ignacio Machin

It doesn't matter if i add 1000 or 10000 rows, after binding the
insert/delete operations are slow, before binding insert/delete
operations are fast. It is a windows application.
Jan 15 '08 #4

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

1
by: sapkal.manish | last post by:
Question : How can I find actual row position of DataTable in DataGridView when DataTable is sorted / My source code like this Private WithEvent dgvInwDet as new DataGridView Private...
3
by: Rich | last post by:
Hello, I am populating a datagridview from a datatable and filtering the number of rows with a dataview object. Is there a way to retrieve the rows displayed by the datagridview into a separate...
1
by: George | last post by:
Hi, I have a DataGridView, bounded to a DataTable which is populated/updated by a OleDbDataAdapter (with OleDbConnection) to an Access Database. (Sounds familiar to some of you ... I have...
3
by: Mike | last post by:
Dear group, I'm currrently investigating a bug within a piece of our software whereby if a DataGridView (bound directly to a DataTable) is ordered by column headers (containing lookup combo...
3
by: sklett | last post by:
I'm changing from a DataGrid to a DataGridView and have run across a problem. The items that are bound to the DataGrid have an int Property that represents a primary key of a lookup table in my...
5
by: DanThMan | last post by:
The situation: * I have a ButtonColumn in a DataGridView. * When the user preses one of the buttons, a dialog appears. * Based on what the user selects in the dialog, data is entered...
2
by: Steve Richter | last post by:
what is the best way to use DataGridView to view data from large database tables? Where the sql select statement might return millions of rows? string connectionString =...
0
by: Chris | last post by:
I have a DataGridView in a form that will display the information from various DataTables in my DataSet. The user is provided a list of tables and when they select a table name, the DataGridView...
3
by: =?Utf-8?B?UGV0ZXI=?= | last post by:
I'm trying to add a datagridview control to a Windows Form to display read-only information in visual basic 2005. My understanding is that datareader will be faster for this purpose. I have the...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.