RowsCopy  RowsMove

Chapter 9: Methods for the DataWindow Control

RowsDiscard

Description

Discards a range of rows in a DataWindow control. Once a row has been discarded using RowsDiscard, you cannot restore the row. You have to retrieve it again from the database.

Syntax

integer dwcontrol.RowsDiscard (long startrow, long endrow, DWBuffer 
buffer ) 

Argument

Description

dwcontrol

The reference to a DataWindow control or child DataWindow.

startrow

The number of the first row you want to discard.

endrow

The number of the last row you want to discard.

buffer

A value of the dwBuffer enumerated datatype specifying the DataWindow buffer containing the rows to be discarded.

For a list of valid values, see DWBuffer.

Returns

Returns 1 if it succeeds and -1 if an error occurs. If any argument’s value is NULL, the method returns NULL.

Usage

Use RowsDiscard when your application is finished with some of the rows in a DataWindow control and you do not want an update to affect the rows in the database. For example, you can discard rows in the delete buffer, which prevents the rows from being deleted when you call Update.

Use Reset to clear all the rows from a DataWindow control.

Examples

Example 1

This statement discards all the rows in the delete buffer for dw_1. As a result if the application later calls dw_1.Update(), the DataWindow will not submit SQL DELETE statements to the DBMS for these rows:

dw_1.RowsDiscard(1, dw_1.DeletedCount(), Delete!)

See also





Copyright © 2004. Sybase Inc. All rights reserved. RowsMove

View this book as PDF