Retrieve

Description

Retrieves rows from the database for a Web DataWindow client control. If arguments are included, the argument values are used for the retrieval arguments in the SQL SELECT statement for the DataWindow object.

Applies to

Web DataWindow client control

Syntax

number objdwcontrol.Retrieve ( ) 

Argument

Description

objdwcontrol

A reference to a Web DataWindow client control.

Returns

Returns -1 if AcceptText fails and otherwise returns the number of rows displayed. AcceptText is called for all methods that reload the page before sending data to the server.

Usage

After rows are retrieved, the DataWindow object’s filter is applied. Therefore, any retrieved rows that do not meet the filter criteria are immediately moved to the filter buffer and are not included in the return count.

Before you can retrieve rows for a Web DataWindow client control, you must specify a transaction object with SetTransaction and establish a database connection.

Calling Retrieve causes data to be retrieved on the server and the page to be reloaded.

All methods that reload the page perform an AcceptText before sending data back to the server. If the method fails (returns -1), this means that pending data changes were not accepted and nothing was sent back to the server. Use the server-side AfterPerformAction event to detect and handle the failure appropriately.

The AfterPerformAction event handler receives an argument of type AfterPerformActionEventArgs that contains an Action property that indicates the client DataWindow postback action, and an ActionResult property that contains the value 1 for success or -1 for failure.

Examples

Example 1

This function in a .aspx file displays the number of rows retrieved and displayed in an alert message:

function btnRetrieve_onclick() {
   alert("Retrieve returned: " +
   objwdw.Retrieve(Form1.deptid.value));
}