By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
434,677 Members | 1,094 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 434,677 IT Pros & Developers. It's quick & easy.

Loading Database Slow VB 2005

P: 29
hi all,

i have problem on loading large database
i am using Firebird Database and VB.NET 2005

it seems really slow to load 10.000+ row on DataGrid

currently i use DataReader to open the database.

is there any method to make it more faster.

should I use DataSet or Data Adapter,
i am confuse what should i use

thx
Mar 8 '08 #1
Share this Question
Share on Google+
8 Replies


debasisdas
Expert 5K+
P: 8,127
That is not the problem of database, but of front end.

But why you need to load 10000 + records in a grid ?
Mar 8 '08 #2

P: 29
That is not the problem of database, but of front end.

But why you need to load 10000 + records in a grid ?


some times my client need to view data from 2005 to 2007
and i display it on grid.

if i not load to grid,where should i load it?

thx
Mar 8 '08 #3

daniel aristidou
100+
P: 491
some times my client need to view data from 2005 to 2007
and i display it on grid.

if i not load to grid,where should i load it?

thx
Well..


Instead you could only show 100 at a time in the data grid... create a next button and previous button to see next 100 and previous 100 records

Is your client gonna look forward to looking through 10k+ records.
Isnt a report better...(just something to consider)
Mar 9 '08 #4

Expert 5K+
P: 8,434
I agree, the slow load time is probably related more to the datagrid than the database. However, you can test this assumption by skipping the database and loading 10,000 test rows into your datagrid. You might use random values, or the same value repeated over and over, for example.
Mar 10 '08 #5

P: 29
i understand
so the grid that takes long time to load

i just confuse what the reason ,cause my customer always complaint.

thx for the info
Mar 10 '08 #6

Expert 5K+
P: 8,434
Before looking too deeply into the "why" I believe you should ensure that you know the "what". We are all assuming that the problem is the datagrid. While I do agree this is probably the cause, you really should check it. A fundamental tenet of debugging is not to assume you know what the problem is, because you'll often be surprised.

Also, is the grid bound to the data source, or are you just using your code to load the information into it a row at a time, or what? In my experience, most grid controls seem to fair poorly as a data repository. Or to put it another way, they seem to be designed more for presentation purposes, formatting things for display, rather than for efficient storage of a large amount of data.

I'm not sure how much of this applies to the datagrid though - if I remember correctly, it more or less just puts a "face" on the data source. So the number of records may not have much effect on it.
Mar 10 '08 #7

P: 29
Before looking too deeply into the "why" I believe you should ensure that you know the "what". We are all assuming that the problem is the datagrid. While I do agree this is probably the cause, you really should check it. A fundamental tenet of debugging is not to assume you know what the problem is, because you'll often be surprised.

Also, is the grid bound to the data source, or are you just using your code to load the information into it a row at a time, or what? In my experience, most grid controls seem to fair poorly as a data repository. Or to put it another way, they seem to be designed more for presentation purposes, formatting things for display, rather than for efficient storage of a large amount of data.

I'm not sure how much of this applies to the datagrid though - if I remember correctly, it's more or less just puts a "face" on the data source. So the number of records may not have much effect on it.
i use my code just to load to datagrid without bound it to data source,
i have try load 10000 row not from database, and it seems like the slow come from the grid.
but i confuse why another application can show it on grid fast, i look at application like Firebird Maestro,it shows the row faster and it using grid too.

thx for the information
Mar 27 '08 #8

Expert 5K+
P: 8,434
i use my code just to load to datagrid without bound it to data source,
i have try load 10000 row not from database, and it seems like the slow come from the grid.
Ok, thanks. I'm glad we've got that confirmed. Hopefully we can ignore the database side of things, then.

but i confuse why another application can show it on grid fast, i look at application like Firebird Maestro,it shows the row faster and it using grid too.
Ah, but is it the same grid control? There are big differences in the way some of them work.

Also, can you show us the code which populates the grid? Perhaps there's something inherently slow there. For example (I'm just making this up) if there are methods to load a row or a cell at a time, loading cell by cell might take a lot longer. Or perhaps your code is doing some very slow transformation of the data before loading it to each row of the grid.

There are all sorts of possibilities.

Keep in mind though, that it's often possible to make an application seem faster, even when it really isn't. This can be done by things like providing user feedback on the process rather than leaving the user to wonder what's going on. The "splash screen" is a prime example. By showing the user that something is happening, they make the load time of the application seem much shorter.

Another possibility might be to continue loading data in the background while the user interacts with the application, instead of making them wait until it's all loaded.

Or, you might be able to find a grid control which works faster.

Or keep the data in an array (or database) and only load enough of it into the grid to populate the screen. In fact, I've seen grid controls (many years ago, forget the details) which allow you to "bind" them to your own event procedure which provides the data. So you can treat the data control as though it is bound to a data source, but the source is your own code, which can be getting the data from anywhere you like (even creating it on the fly, or whatever).
Mar 28 '08 #9

Post your reply

Sign in to post your reply or Sign up for a free account.