Was this page helpful?
Your feedback about this content is important. Let us know what you think.
Additional feedback?
1500 characters remaining
DataServiceContext Class

DataServiceContext Class

The DataServiceContext represents the runtime context of the data service.

Namespace:  System.Data.Services.Client
Assembly:  System.Data.Services.Client (in System.Data.Services.Client.dll)

public ref class DataServiceContext

This topic describes new functionality in ADO.NET Data Services that is available as an update to the .NET Framework version 3.5 Service Pack 1. You can download and install the update from the Microsoft Download Center.

ADO.NET Data Services are stateless, but the DataServiceContext is not. State on the client is maintained between interactions in order to support features such as update management. This class, and the DataServiceQuery class that represents a particular HTTP request to a data service, are the two main classes in the client library.

The following example shows how to use the DataServiceContext generated by the Add Service Reference tool to implicitly execute a query against the Northwind data service that returns all customers. The URI of the requested Customers entity set is determined automatically by the context. The query is executed implicitly when the enumeration occurs. The Northwind data service is created when you complete the ADO.NET Data Services quickstart.

No code example is currently available or this language may not be supported.


Any public static (Shared in Visual Basic) members of this type are thread safe. Any instance members are not guaranteed to be thread safe.

Windows 7, Windows Vista, Windows XP SP2, Windows Server 2008 R2, Windows Server 2008, Windows Server 2003

The .NET Framework and .NET Compact Framework do not support all versions of every platform. For a list of the supported versions, see .NET Framework System Requirements.

.NET Framework

Supported in: 3.5 SP1

Community Additions

© 2015 Microsoft