473,854 Members | 1,684 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

How to optimize datagrid loading speed

The sql query for my datagrid returns 100, 000 records. But the datagrid
should display 20 records per page. I am using datagrid paging, but it is
taking too much time for the page to load. Is there any way I can optimize
the speed. Any sample code would be great.

Thanks,

Reddy
Nov 18 '05 #1
3 2829
There is no way to optimize the speed. 100k records will take a long time to
load. There is no way around that. What you can do is implement custom
paging and keep going to the database for pages of 20 rows, that way you are
carrying 20 records per trip. Loading 100,000 records is a seriously bad
idea anyway. Memory allocation and deallocation will be a problem causing
your app to recycle.

One approach used by some websites is to have an index at the top of the
page, usually an alphabetized listing. Clicking on a letter gets just the
records for that letter. It's all in an effort to reduce the large number of
records going back and forth.

--
Regards,
Alvin Bruney
Got tidbits? Get it here...
http://tinyurl.com/3he3b
"Reddy" <an********@NO. JUNK.MAIL> wrote in message
news:%2******** ********@tk2msf tngp13.phx.gbl. ..
The sql query for my datagrid returns 100, 000 records. But the datagrid
should display 20 records per page. I am using datagrid paging, but it is
taking too much time for the page to load. Is there any way I can optimize
the speed. Any sample code would be great.

Thanks,

Reddy

Nov 18 '05 #2
Thanks Alvin.

In the old ADO we used to optomize it for around 50,000 records. Thought
there might a way around in .NET as well.

Regards,
"Alvin Bruney" <vapor at steaming post office> wrote in message
news:ed******** ******@TK2MSFTN GP12.phx.gbl...
There is no way to optimize the speed. 100k records will take a long time to load. There is no way around that. What you can do is implement custom
paging and keep going to the database for pages of 20 rows, that way you are carrying 20 records per trip. Loading 100,000 records is a seriously bad
idea anyway. Memory allocation and deallocation will be a problem causing
your app to recycle.

One approach used by some websites is to have an index at the top of the
page, usually an alphabetized listing. Clicking on a letter gets just the
records for that letter. It's all in an effort to reduce the large number of records going back and forth.

--
Regards,
Alvin Bruney
Got tidbits? Get it here...
http://tinyurl.com/3he3b
"Reddy" <an********@NO. JUNK.MAIL> wrote in message
news:%2******** ********@tk2msf tngp13.phx.gbl. ..
The sql query for my datagrid returns 100, 000 records. But the datagrid
should display 20 records per page. I am using datagrid paging, but it is taking too much time for the page to load. Is there any way I can optimize the speed. Any sample code would be great.

Thanks,

Reddy


Nov 18 '05 #3
what do you mean optimize it for 50,000 records? Maybe I'm over-looking
something. Can you explain how you would do this?

--
Regards,
Alvin Bruney
Got tidbits? Get it here...
http://tinyurl.com/3he3b
"Reddy" <an********@NO. JUNK.MAIL> wrote in message
news:OE******** ******@TK2MSFTN GP11.phx.gbl...
Thanks Alvin.

In the old ADO we used to optomize it for around 50,000 records. Thought
there might a way around in .NET as well.

Regards,
"Alvin Bruney" <vapor at steaming post office> wrote in message
news:ed******** ******@TK2MSFTN GP12.phx.gbl...
There is no way to optimize the speed. 100k records will take a long time
to
load. There is no way around that. What you can do is implement custom
paging and keep going to the database for pages of 20 rows, that way you are
carrying 20 records per trip. Loading 100,000 records is a seriously bad
idea anyway. Memory allocation and deallocation will be a problem causing your app to recycle.

One approach used by some websites is to have an index at the top of the
page, usually an alphabetized listing. Clicking on a letter gets just the records for that letter. It's all in an effort to reduce the large

number of
records going back and forth.

--
Regards,
Alvin Bruney
Got tidbits? Get it here...
http://tinyurl.com/3he3b
"Reddy" <an********@NO. JUNK.MAIL> wrote in message
news:%2******** ********@tk2msf tngp13.phx.gbl. ..
The sql query for my datagrid returns 100, 000 records. But the datagrid should display 20 records per page. I am using datagrid paging, but it

is taking too much time for the page to load. Is there any way I can optimize the speed. Any sample code would be great.

Thanks,

Reddy



Nov 18 '05 #4

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

Similar topics

11
2147
by: Michael B. | last post by:
I'm still learning C so I've written a simple app which lets you make a contact list (stored as a linked list of structs), write it to a file, and read it back. It works fine, but I notice in my loading procedure there's a point or two where I'll malloc a struct which I then don't need, and dispose of it; I was wondering if there was some way I could optimize this kludge out of existence: void loadContacts () { int fd, bytesread; if (...
2
1705
by: John Smith | last post by:
Hey folks, I'm writing a Windows application which has many forms which have Datagrids on them to display data. These datagrids will not be editable in anyway. They are there to just view the results of a query (and perhaps double click on a row to open a new form). Additionally, the queries will often involve the use of 5 or more tables. Because efficiency (both speed and memory) is the primary concern what is the best method to...
5
12252
by: John Richardson | last post by:
I've been bothered for some time about my DataGrid not populating my rows very quickly. I have about 10K rows loading into the grid. I create a datatable dt with 2 columns, an ID and a display. The ID is a member of the keys array. I then create a DataView dv over the table, and sort it by Display and ID column (in case of duplicate Display). I then set my DataGrid.DataSource = dv; I then load the datatable with my rows, and this is...
2
1285
by: David C | last post by:
I designed a datagrid with editable server controls such as text boxes, dropdowns in each row. That way, the user does not have to click "Edit" to get the editable controls. And with one save button, I loop through each item, FindControl on each field, and save all the records displayed by the datagrid on one swoop. The problem is, it takes a looong time to draw the server control initially since all rows have to be populated with...
5
2799
by: tshad | last post by:
Is there a way to carry data that I have already read from the datagrid from page to page? I am looking at my Datagrid that I page through and when the user says get the next page, I have to go to the database to get the next page. Is there a way to use the dataset to allow us to read back and forth in it instead of going back to the database to get it? Thanks,
4
3299
by: jaYPee | last post by:
I have already done some code to fill the datagrid. my problem is that the fill method is too slow after executing my code. here is the scenario. i have a parent/child form. all is datagrid. one datagrid is a parent and the other is a child. now when i finish encoding data from the first datagrid (which is the parent) i have to click the check box button on that grid and fill the 2nd grid w/ the data from the other table base on the...
1
1814
by: Bala | last post by:
Hi, Currently i am loading the file names into datagrid (unbound) from a folder(sub folders too). so for this i am using this below code. but its too slow to loading all the file names. is it any other method to make it fast loading bala code:
13
3131
by: Frank Swarbrick | last post by:
IBM has a product for the VSE operating system called the VSAM Redirector. It allows you to use VSAM to access RDBMS tables/views as if they were actual VSAM files. We're doing a comparison right now between Oracle, which we've been running in production for many years, and DB2, which we are just starting with. One of the tests I am trying is to see how efficient the VSAM Redirector works with DB2 versus Oracle. Below are two types of...
2
2096
by: pavanip | last post by:
Hi, I have an application like Optimize System Performance by using Memory speed, cpu speed and Disk speed. How to optimize memory speed,disk optimization and CPU optimization. Please provide me some sample source code to optimize system performance. Thanks pavani
0
9750
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
11024
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
1
10744
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 Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
9510
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, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
1
7909
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
7077
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
5937
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
4550
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
3
3182
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

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.