Hyderabad Jobs Book Website FREE PowerBuilder Training I Love Hyderabad Hyderabad Colleges
Home Business Emails Hyderabad Classifieds Contact Us
7 Wonders of Hyderabad Web Hosting Yellow Pages Our Network

 
Webpowerbuilder.hyderabad-colleges.com

Advanced PowerBuilder

HomePrevious Lesson: Data Retrieval Cancellation
Next Lesson: Appending a Row Automatically

Appending the New Result Set to the DataWindow

Every time you call Retrieve() function, PowerBuilder clears the DataWindow and populates with the new results. By the term 'clearing' we do not mean moving the data from Primary buffer to the Delete buffer, it means, resetting the DataWindow as if you never issued a Retrive() function on that DataWindow. If the DataWindow has any modified or new rows that weren't applied in the database, you will not get any warning or error message, it simply discards all rows in the DataWindow. It is equaliant to calling Reset() function internally by the Retrieve() function. Reset() function discards all rows from all buffers in a given DataWindow.

Now, for any reason, if you want to retain the existing data and want to append the new result set from the Retrieve() function, what you do? For example, you issued Retrieve() and got say 1000 rows. Now you want to issue another Retrieve() function with different arguments (say, you are expecting 200 rows) and want to append those 200 rows to the DataWindow; Upon completion, you want to see 1200 rows in the DataWindow.

What you can do is, create a DataStore or a hidden DataWindow and assign the same DataWindow object. Retrieve data into the new DataStore/DataWindow and move those rows into the original DataWindow using RowsMove() function and set all those moved rows status to NotModified!

Even though it solves the problem, it is not the right solution. Rather you can solve this problem with a single line of code. Do you recall it from the 'DataWindow Events' topic? You need to return 1 from the RetrieveStart event. It is as simple as that.
HomePrevious Lesson: Data Retrieval Cancellation
Next Lesson: Appending a Row Automatically

Copyright © 1996 - 2006 HamaraShehar.com Pvt. Ltd. All Rights Reserved.
Domain Registration, Website Design, Website Hosting by HamaraShehar.com