Book Image

Windows Phone 7.5 Data Cookbook

By : Ramesh Thalli
Book Image

Windows Phone 7.5 Data Cookbook

By: Ramesh Thalli

Overview of this book

Windows Phone 7.5 Mango contains support for apps written in Silverlight or XNA. These apps can store data on the device, and also load and manipulate data from "the cloud" and other web services.This Windows Phone 7.5 Data Cookbook has a range of recipes to help you apply data handling concepts. You will be able to apply the knowledge gained from these recipes to build your own apps effectively. This Windows Phone 7.5 Data Cookbook starts with data binding concepts at the UI layer and then shows different ways of saving data locally and externally in databases. The book ends with a look at the popular MVVM software design pattern. The recipes contained in this book will make you an expert in the areas of data access and storage.
Table of Contents (15 chapters)
Windows Phone 7.5 Data Cookbook
Credits
About the Author
About the Reviewers
www.PacktPub.com
Preface
Index

WCF using ADO.NET Entity Framework


In this recipe, let's use the SQL Server database as the backend. We will create the MyTask table in the SQL Server Express database.

Getting ready

For this recipe, let's create a WCF service project similar to the last recipe. Let's call this project Recipe3_WCFSQLService.

How to do it...

In this recipe, we will create the WCF Service project with SQL Server as the backend database. We use the ADO.NET Entity Framework to create all the entity objects, and then we add the methods to return the results to the client application.

  1. In this recipe, we will add SQL Server Express database to the project. Name it MyTasks.mdf.

  2. Double-click the database to open it and then right-click on Tables to add a new table. Call this table MyTask and add the columns as shown in the following screenshot:

  3. After the table is created, add a couple of test records using insert statements; or you can directly enter them in the result grid.

  4. Now using the graphical view build a query by...