Welcome
Welcome to <strong>Sybase Philippines</strong>.

You are currently viewing our boards as a guest, which gives you limited access to view most discussions and access our other features. By joining our free community, you will have access to post topics, communicate privately with other members (PM), respond to polls, upload content, and access many other special features. Registration is fast, simple, and absolutely free, so please, <a href="/profile.php?mode=register">join our community today</a>!

deleting all rows....

Updated with the latest technology, this powerful, industry-leading rapid application development tool offers tight integration between design, modeling, development and management. PowerBuilder enables developers to build anything from two-tier and Web applications to applications for a distributed architecture.

deleting all rows....

Postby paul on Mon Dec 10, 2007 12:59 pm

hi to all pb programmers:

Can somebody help me on how to delete all rows on a datawindow.

For example there are five rows in dw_1... then delete this five rows in just one execution.

Pls. give a sample code to do this..

thanks!..
paul
 
Posts: 2
Joined: Mon Nov 26, 2007 12:50 pm

Delete all rows in One execution from datawindow

Postby SaimaShirani on Mon Dec 17, 2007 12:20 pm

Use this Loop

Do While dw_1.Rowcount() > 0
dw_1.DeleteRow(1)
dw_1.Update();
Loop
This wil delete all rows from your datawindow with the help of single execution
SaimaShirani
 
Posts: 5
Joined: Tue Nov 27, 2007 4:13 am

Postby Erick Ilo on Mon Dec 17, 2007 12:54 pm

Hi! How about moving the rows from the primary buffer to the delete buffer, instead of deleting them one at a time. :idea:


dw_1.RowsMove(1, dw_1.RowCount(), Primary!, dw_1, 1, Deleted!)

All the rows in dw_1 will be marked for deletion (i.e. deleted pending update & commit)
Erick Ilo
 
Posts: 3
Joined: Fri Aug 17, 2007 3:17 am
Location: Manila, Philippines

Postby SaimaShirani on Tue Dec 18, 2007 6:12 am

Yes we can also use this method that will move all rows from the datawindow Primary buffer to the Delete buffer where the rows will be deleted when you update Datawindow.
SaimaShirani
 
Posts: 5
Joined: Tue Nov 27, 2007 4:13 am

Postby vicgclemente on Wed Jul 09, 2008 1:39 am

If you want to just clear the datawindow with all rows without affecting the records in the database, you can use the Reset() function. dw_1.Reset() will clear/delete the rows from the dw_1 datawindow.
vicgclemente
 
Posts: 1
Joined: Wed Jul 09, 2008 1:09 am


Return to PowerBuilder

Who is online

Users browsing this forum: No registered users and 0 guests

cron