Sys.Data.AdoNetServiceProxy.query Method

Reads data from a data service.

query: function(query, succeededCallback, failedCallback, userContext, webRequest)

Usage

exampleDataService.query(query, succeededCallback, failedCallback, userContext, webRequest);

Parameters

Parameter

Definition

query

(Optional) The path that defines the data to return from the query operation.

succeededCallback

(Optional) The function to execute when the insert operation succeeds.

failedCallback

(Optional) The function to execute when the insert operation fails.

userContext

(Optional) The state object for this operation.

webRequest

(Optional) The Sys.Net.WebRequest object to use for the Web request instead of the default Web request object.

Return Value

The Sys.Net.WebRequest object that performed the operation.

Remarks

Use the query method to retrieve data from a data service. If you do not provide a value for the query parameter, the top-level collection is retrieved. The query method immediately executes a single query operation.

The signatures for the callback functions must match the following examples:

function callbackSucceeded(result, context, operation)

function callbackFailed(error, context, operation)

The functions that you assign to the callback functions must accept three parameters. The first parameter contains the result (or error) returned by the data service. The second parameter contains the state object for the data operation. The third parameter contains a description of the operation that was performed. For query operations, the third parameter contains the string that defined the query.

If you do not provide a value for the webRequest parameter, the AdoNetServiceProxy class creates a new instance of the Sys.Net.WebRequest class.

See Also

Other Resources

Sys.Data.AdoNetServiceProxy Class