Jump to content


dee

Member Since 05 Dec 2006
Offline Last Active Dec 17 2007 01:06 PM
-----

Posts I've Made

In Topic: Sorting problems

17 December 2007 - 01:00 PM

Hi...

I don't know if what I'm posting is relevant to this topic or not. But I would like to know is there a way for the NextGrid to do a secondary sort?

In Topic: Suggestion to improve speed

10 December 2007 - 10:24 AM

QUOTE (Boki (Berg) @ Dec 8 2007, 06:19 PM) <{POST_SNAPBACK}>
Hello Dee,

I have build small example to show you how to fill grid with TDataLink. I am not sure that this is fast enough for you but it worth looking.

[attachment=369:DataLink.zip]

I have use small ADO table in this example, but you may change this very easy.

I hope that this helps smile.gif

Best regards


Hi Boki,

First of all, I would like to thank you for all your troubles. You have my gratitude smile.gif

I've tried to apply it on my application, but it didn't improve the speed for my application. I measured the time in 1/1000 of a second. Using DataSet.Next is around 10% faster. And I've tried it many times. Is this a weird case?

Anyways, the dataset I use is always from a query executed at runtime. It's not a table. Does this explain why using DataLink is not any faster?

In Topic: Suggestion to improve speed

10 December 2007 - 04:30 AM

QUOTE (didiergm @ Dec 8 2007, 05:31 PM) <{POST_SNAPBACK}>
Dee,

Maximum speed would be achieved by making sure that
1- all windows refresh operations are blocked dataset->disablecontrols, ... do your work, the re-enablecontrols, same with the grid: begin update/endupdate
2- keeping the data in your dataset to the minimum required (ie do not use a ttable, use a tquery instead with a restrictive select)
If you want to load in memory, have a look at tClientDataset it will load a dataset through a Tdataset provider, so you have

TQuery (of some sort) -> tdatasetprovider ->tDatasource -> tClientDataset

there is a video from the last CodeRage II http://video.codegea...psAndTricks.zip which explains things

hth

Didier


Hi Didier,

Thank you for the tips. I will remember and apply those to my code. I'm still downloading the video. Will take a look at it. Thanx again, I really appreciate it smile.gif

In Topic: Suggestion to improve speed

08 December 2007 - 06:32 AM

QUOTE (wvd_vegt @ Dec 7 2007, 01:33 PM) <{POST_SNAPBACK}>
Hi,
I never can get the db stuff working (and am an experienced programmre) so always use a non dbaware grid. Some months ago I wrote a TCollection that loads a database table into memory using rtti (Runtime Type Information) so the loading routines automatically adjust to the table.

These TCollections are represented in various TNextGrid tables. When I edit someting there I flag the item as dirty and can then save all changed ones at once when destroying the collection for example. The Collections contain routines to create and populate the NextGrid as I like (for example in slide mode) and to do silent lookups in other collections/tables. I even managed to create slides that contains lists of dates (so group records together) that way.

To make sure the records are linked correctly to the table rows i use the GuidColumn to generate a unique id independend of the database auto increment fields. Drawback is that it's only working fine when the database is a single user one. Updates in tables are performed with SQL queries instead of direct table access.


Hi,

I understand what you are saying. And most of the time, our concepts are very similar. But maybe the main difference is I do not load a database table into memory, but instead, I read every record and populate each row of the NextGrid. This can be quite slow, so I need to find a fast way to load my dataset into memory and then populate the rows of NextGrid from memory.

Maybe I do not exactly understand how datasets work, but I use this code A LOT:
CODE

while not DataSet1.Eof do
begin
{ do things here, usually populate the grid }

DataSet1.Next;
end;


And from my new understandings I got from this great forum, the bottleneck is the DataSet1.Next. Can you give me some clues to improve the speed? Thanx in advance smile.gif

In Topic: Suggestion to improve speed

05 December 2007 - 06:15 AM

QUOTE (Boki (Berg) @ Dec 4 2007, 08:06 PM) <{POST_SNAPBACK}>
Hello Dee,

I will write this sample for you. I will need few days (due to started bugs/features I need to finish) and then I will send it to you.

Best regards


Thank you very much, Boki... Please take your time smile.gif I highly appreciate it...