473,325 Members | 2,872 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,325 software developers and data experts.

Too slow to use datagrid display records

I am trying to display some database records in datagrid using dataset.

the records need to be displayed are couple of thousands, but the records in
database that the SQL query needs to exam are more than 70 thousand, and it
is really slow to get the dataset ready to populate the datagrid.

I am sure there are solutions on this issue, but I just don't know :-(

Can anybody point me out any good solution to minimize the time used to
populate the datagrid?

Thanks a lot!

One thing I thought of is to make the datagrid starts to display records
simultaneously when data is filling into dataset. but I am not sure how to
achieve that.
Nov 21 '05 #1
3 5375
Hi,

Here are few articles that might help.
http://www.vb-tips.com/default.aspx?...6-fc0d5c470f53

http://www.vb-tips.com/default.aspx?...6-def86a1baeef

Ken
--------------------
"Kai Zhang" <ka*******@zeron.biz> wrote in message
news:%2****************@TK2MSFTNGP10.phx.gbl...
I am trying to display some database records in datagrid using dataset.

the records need to be displayed are couple of thousands, but the records
in database that the SQL query needs to exam are more than 70 thousand,
and it is really slow to get the dataset ready to populate the datagrid.

I am sure there are solutions on this issue, but I just don't know :-(

Can anybody point me out any good solution to minimize the time used to
populate the datagrid?

Thanks a lot!

One thing I thought of is to make the datagrid starts to display records
simultaneously when data is filling into dataset. but I am not sure how to
achieve that.

Nov 21 '05 #2
Thanks for your reply, Ken.

for the first link:
http://www.vb-tips.com/default.aspx?...6-fc0d5c470f53
It allows user to know how much records have been loaded, and how long it
may take to finish loading the records, however, it does not allow user to
view the records quicker (unless update "Datagrid.DataSource" while
Datareader is reading records which may be very nasty, but I will have a
try).

for the second link:
http://www.vb-tips.com/default.aspx?...6-def86a1baeef
I am using the SQL 2000, so I cannot use this approach unless I implement
the NTile() by myself.

Nov 21 '05 #3
Hi Ken,
I did some changes to the sample code you suggested me to read on link:
http://www.vb-tips.com/default.aspx?...6-fc0d5c470f53

Here is my code:
...
dgbase.DataSource = table 'dgbase is the datagrid,
'table is a DataTable
which already has columns
While reader.Read 'reader is a SqlDataReader
Dim row As DataRow
row = table.NewRow()

Dim tempObject(table.Columns.Count - 1) As Object
reader.GetValues(tempObject)
row.ItemArray = tempObject

table.Rows.Add(row) 'Add new row to dgbase.DataSource
dgbase.Refresh() 'show the new added row
End While
...

The above code works fine, except all the controls on the form do not
respond to any interaction while the records is loaded into datagrid.

I know I can solve this by using a separate thread to run the above code,
and I am working on it. hopefully it will be OK.

Thanks again, Ken.
"Kai Zhang" <ka*******@zeron.biz> wrote in message
news:eT**************@tk2msftngp13.phx.gbl...
Thanks for your reply, Ken.

for the first link:
http://www.vb-tips.com/default.aspx?...6-fc0d5c470f53
It allows user to know how much records have been loaded, and how long it
may take to finish loading the records, however, it does not allow user to
view the records quicker (unless update "Datagrid.DataSource" while
Datareader is reading records which may be very nasty, but I will have a
try).

for the second link:

http://www.vb-tips.com/default.aspx?...6-def86a1baeef
I am using the SQL 2000, so I cannot use this approach unless I implement
the NTile() by myself.

Nov 21 '05 #4

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

Similar topics

12
by: Neil | last post by:
I previously posted re. this, but thought I'd try again with a summary of facts. I have an Access 2000 MDB with a SQL Server 7 back end. There is a view that is linked to the database via ODBC...
2
by: Jarek Micha³owski | last post by:
Hi, i am newbie here and need help. Subject: Multidimmensional Cube In the following code I send the sql query to mssql and retrive data to objCellSet object. My problem is: In retrive data I have...
6
by: VM | last post by:
I have a 35000 line datagrid and updating one field in all 35000 rows takes an eternity. How come? Since I don't have the datasource available (it may be a table or view), in my example I do it...
3
by: Jennyfer J Barco | last post by:
In my application I have a datagrid. The code calls a Stored procedure and brings like 200 records. I created a dataset and then a dataview to bind the results of the query to my grid using ...
1
by: jwogick | last post by:
I'm hoping someone can help me! I just have a simple form with a datagrid displaying child records from a dataset that contains two related tables Parent table>Clients Child table>cases. using the...
3
by: qilinw | last post by:
In a winform I want to display database records using datagrid, with dataset for a couple of thousands records it seems very slow. I have read an article in group...
7
by: Arpan | last post by:
Assume that a database table has the following 4 columns - ID, UserID, Subject & Marks. I am retrieving the records existing in this DB table & displaying them in a DataGrid like this: <script...
3
by: archana | last post by:
Hi all, Can anyone tell me what exactly VirtualItemCount in datagrid. I read on msdn but not clear about it. Any help will be truely appreciared. thanks in advance
13
by: eighthman11 | last post by:
using Access 2003 and sql server version 8.0 Hey everyone. Created a text box where the user types in an Inventory number and it takes them to that inventory number on the contimuous form. The...
0
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
1
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: Vimpel783 | last post by:
Hello! Guys, I found this code on the Internet, but I need to modify it a little. It works well, the problem is this: Data is sent from only one cell, in this case B5, but it is necessary that data...
0
by: jfyes | last post by:
As a hardware engineer, after seeing that CEIWEI recently released a new tool for Modbus RTU Over TCP/UDP filtering and monitoring, I actively went to its official website to take a look. It turned...
0
by: ArrayDB | last post by:
The error message I've encountered is; ERROR:root:Error generating model response: exception: access violation writing 0x0000000000005140, which seems to be indicative of an access violation...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
1
by: Defcon1945 | last post by:
I'm trying to learn Python using Pycharm but import shutil doesn't work
1
by: Shællîpôpï 09 | last post by:
If u are using a keypad phone, how do u turn on JavaScript, to access features like WhatsApp, Facebook, Instagram....
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...

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.