Skip navigation

Introducing ADO.NET Data Services




Introducing ADO.NET Data Services


By Joydip Kanjilal


ADO.NET Data Services can be used to expose an application s data as a service so that it can be consumed by Web applications. You can use ADO.NET Data Services to isolate the presentation and data access layers of your application and discover, manipulate, and retrieve data in a corporate network. This article takes a brief look at what ADO.NET Data Services are, the features and benefits, and how they can be integrated with ADO.NET Entity Framework to expose the application s data as a data service.


The Prerequisites

You should have the following installed in your system to work with ADO.NET Data Services:

  • Microsoft Visual Studio 2008
  • Microsoft SQL Server 2005 or SQL Server Express
  • ASP.NET Extensions CTP
  • ADO.NET Entity Framework Beta 3
  • ADO.NET Entity Framework Tools CTP


What Are ADO.NET Data Services?

The Astoria team says, ADO.NET Data Services (also known as Project code name Astoria ) consists of a combination of patterns and libraries that enables any data store to be exposed as a flexible data service, naturally integrating with the Web, that can be consumed by Web clients within a corporate network or across the Internet. You can use ADO.NET Data Services to expose data through Web services in terms of EDM abstractions, i.e., as Entity Data Model (EDM) objects. These objects can then be accessed by any Web application much the same way a Web service is accessed. To learn more about the ADO.NET Entity Framework and Entity Data Model, take a look at my article titled Objectify Your Application s Data.


In the section that follows, we ll take a step-by-step look at how to get started with ADO.NET Data Services.


Getting Started

Follow these simple steps to get started with ADO.NET Data Services:

  • Click on File | New | New Web Site in Visual Studio
  • Choose ASP.NET Web Site from the list of the Visual Studio Installed templates and save it with a name as shown in Figure 1.
  • Next, right-click on the project in the solution explorer and choose Add New Item.
  • Select ADO.NET Data Service from the list of the templates displayed and click Add (see Figure 2).
  • Now add LINQ to SQL classes in your project (see Figure 3).
  • Then configure the data service to use the data context.


Figure 1


Figure 2


Figure 3


You re done! You can now call this data service from your Web applications to locate and manipulate data in your applications.


You can get more information about ADO.NET Data Services and the ADO.NET Entity Framework in my upcoming book, Data Persistence with ADO.NET Entity Framework (Packt Publishing).



ADO.NET Data Services are great in the sense that you can expose your application s data as a service, then consume it from Web applications through HTTP requests and perform CRUD operations seamlessly. Wikipedia states, ADO.NET Data Services (codename Astoria ) is a platform for what Microsoft calls Data Services. It is actually a combination of the runtime and a web service through which the services are exposed. In addition, it also includes the Data Services Toolkit which lets Astoria Data Services be created from within ASP.NET itself. (


This article has had a brief look at what ADO.NET Data Services are, the features, and how we can get started.


Joydip Kanjilal is a Microsoft MVP in ASP.NET. He has more than 12 years of industry experience in IT with more than six years in Microsoft .NET and its related technologies. He has authored articles for some of the most reputable sites, including,,,,, and Many of these articles have been selected at, Microsoft s official site for ASP.NET. Joydip was also a community credit winner at a number of times. He is currently working as a Lead Architect in a reputable company in Hyderabad, India. He has years of experience in designing and architecting solutions for various domains. His technical strengths include, C, C++, VC++, Java, C#, Microsoft .NET, AJAX, Design Patterns, SQL Server, Operating Systems, and Computer Architecture. Joydip blogs at and spends most of his time reading books and blogs, and writing books and articles. His hobbies include watching cricket and soccer and playing chess.





Hide comments


  • Allowed HTML tags: <em> <strong> <blockquote> <br> <p>

Plain text

  • No HTML tags allowed.
  • Web page addresses and e-mail addresses turn into links automatically.
  • Lines and paragraphs break automatically.