This article has been archived. It is offered "as is" and will no longer be updated.
This article describes an All-In-One Code Framework sample that is available for download. This code sample includes a step-by-step guide for how to create and then to call Microsoft ADO.NET Data Services for different data sources. These data sources include the ADO.NET Entity Framework, LINQ to SQL, and the reflection provider.
To download this code sample, click the following link:
ADO.NET Data Services consists of a combination of patterns and libraries that enables data services for the Web to be created and consumed. The goal of ADO.NET Data Services is to facilitate the creation of flexible data services that can be integrated naturally with the Web. Therefore, ADO.NET Data Services uses Uniform Resource Identifiers (URIs) to point to pieces of data and then uses simple, well-known formats to represent that data. Examples of these formats include JSON and ATOM (XML-based feed format. This behavior leads to the data service being surfaced as a REST-style resource collection that can be addressed by using URIs. Additionally, agents can interact with the data service by using standard HTTP verbs such as GET, POST, PUT or DELETE.
In order for the system to understand and to leverage semantics over the data that is surfacing, ADO.NET Data Services models the data that is exposed through the data service by using a model called Entity Data Model (EDM) and Entity-Relationship derivative. This model organizes the data into the form of instances of “entity types,” of “entities,” and of the associations between them.
For relational data, ADO.NET Data Services supports exposing an EDM model that is created by using the ADO.NET Entity Framework. To enable all other data sources to use additional database access technologies (such as LINQ to SQL), a mechanism is provided which enables any data source to be modeled as entities and as associations. This means that any data source can be described by using an EDM schema. This mechanism also enables any data source to be exposed as a data service.
This All-In-One Code Framework sample shows how to create and to call ADO.NET Data Services to perform Create, Read, Update, and Delete (CRUD) operations on different data sources. These data sources include the ADO.NET Entity Framework, LINQ to SQL, and the reflection provider.
Note For more information about how to create the sample application and how to deploy the sample application, see the Readme.txt file that is included in the download package.
ADO.NET Data Services
This code sample contains the following programming languages:
Visual Basic .NET
You must first deploy the SQLServer2005DB database by running the SQLServerDB.sql script. Then, you must modify the connection string in the Web.config file according to your database instance and login account. For more details, refer to the Readme.txt file that is included in the downloaded package.
This sample application was created by using Visual Studio 2008 Service Pack 1.
ADO.NET Data Services, Entity Framework, LINQ to SQL
What is All-In-One Code Framework?
All-In-One Code Framework shows most Microsoft development techniques by using code samples in different programming languages. Each example is carefully selected, composed, and documented to show one common code scenario. For more information about All-In-One Code Framework, visit the following Web site: http://cfx.codeplex.com
How to find more All-In-One Code Framework samples
Microsoft corporation and/or its respective suppliers make no representations about the suitability, reliability, or accuracy of the information and related graphics contained herein. All such information and related graphics are provided "as is" without warranty of any kind. Microsoft and/or its respective suppliers hereby disclaim all warranties and conditions with regard to this information and related graphics, including all implied warranties and conditions of merchantability, fitness for a particular purpose, workmanlike effort, title and non-infringement. You specifically agree that in no event shall Microsoft and/or its suppliers be liable for any direct, indirect, punitive, incidental, special, consequential damages or any damages whatsoever including, without limitation, damages for loss of use, data or profits, arising out of or in any way connected with the use of or inability to use the information and related graphics contained herein, whether based on contract, tort, negligence, strict liability or otherwise, even if Microsoft or any of its suppliers has been advised of the possibility of damages.