Prodataset Dataset get record count.

Posted by mhtan88 on 04-Nov-2009 19:26

hi all,

may i know is there any way to do like

DATASET dsdata:REcord-count. something like this instead of

for each tttemp:

i = i + 1.

end.

messsage "record count: " i

Thank you.

Regards,

TaNMH

All Replies

Posted by Admin on 05-Nov-2009 01:25

The DATASET has no attribute that returns the number of rows.

When you are on GUI for .NET and have a proBindingSource connected to the dataset, you may use the Count property of the proBindingSource. That returns the number of rows in the top-level-buffer.

A generic approach would be to use a preselect query. That's usually faster than the FOR EACH loop. You might use the datasets TOP-NAV-QUERY for this purpose:

DATASET dsCustomer:TOP-NAV-QUERY:QUERY-PREPARE

    (SUBSTITUTE ("PRESELECT EACH &1", DATASET dsCustomer:GET-TOP-BUFFER(1):NAME)) .

DATASET dsCustomer:TOP-NAV-QUERY:QUERY-OPEN () .

MESSAGE DATASET dsCustomer:TOP-NAV-QUERY:NUM-RESULTS 

    VIEW-AS ALERT-BOX.

Posted by maura on 05-Nov-2009 09:33

Mike is correct. You can use the preselect option if not bound to a ProBindingSource.

Maura Regan

Posted by mhtan88 on 08-Nov-2009 20:48

thanks for your reply 

This thread is closed