I had a request to create a proof of concept app on how to connect a Windows Phone 7 Silverlight application to a SQL Server database hosted on a PC. Since the Windows Phone API does not allow the developer to connect directly to the SQL Server, one has to create a WCF (Windows Communication Foundation) service that will expose operations to interact with the database. Let’s do this! 1. I’ll be using Northwind database for the sample, and I’m including it as part of the files for download. You can use any database you want, of course. First, let’s create a web service application. We’ll be using the ASP.NET empty website template for this matter. 2. Let’s create a new ADO.NET Entity Model, in order to use the powerful Entity Framework to do our job. We call it NorthwindModel 3. We generate it from database, choose to include sensitive data in our connection string, check the table “Customers” and check “Pluralize or singularize generated object names”. 4.We create a new *Silverlight-enabled” web service in our

Διαβάστε περισσότερα »