Sys.Data.DataService
Provides methods and properties for interacting with ADO.NET data services.
For an example that demonstrates this type, see How to: Query a Data Service Using AJAX.
Namespace: Sys.Data
Inherits: None.
Syntax
var a = new Sys.Data.DataService(serviceUri);
Public Constructors
Members
Remarks
The DataService class provides functions that you can call in order to interact with a data service from an ASP.NET AJAX application. By using this class, you can easily create Web applications that interact with data from the Web site and that can update the Web page without a full postback to the Web server.
When you create an instance of the Sys.Data.DataService class, you provide the relative URI of the data service that contains the data that you want to retrieve, as shown in the following example:
var exampleService =
new Sys.Data.DataService("/northwind.svc");
After you create an instance of the DataService class, you can set properties of the class that are used as the default properties in all data operations. These properties include:
The defaultSucceededCallback and defaultFailedCallback properties contain the names of the functions that will be called after the data operation has succeeded or failed. The defaultUserContext property contains the context information that is passed as a parameter to the callback functions, unless you provide a different user context when you call a data operation.
The insert, query, remove, and update methods enable you to perform a single operation. The createActionSequence method enables you to create an ActionSequence object and add operations to a queue that are executed as a single batch. The invoke method enables you to execute a method on the data service.
This topic is ASP.NET Extensions documentation and is unsupported by Microsoft. Blank topics are included as placeholders and existing content is subject to change in future releases.