You will see project layout like this. Web project works like server project all database related classes and services, .aspx test pages, configuration file and other project has all .xaml pages controls. Now add a new Silverlight enabled wcf service.In this sample I am using NORTHWND database which is available in App_Data folder. First add a new class in web project.Customers.csusing System;
usingSystem.Collections.Generic;
usingSystem.Linq;
usingSystem.Web;namespace SilverlightCRUD_Using_WCFService.Web
{
public class Customers
{
public string CustomerID { get; set; }public string CompanyName { get; set; }public string ContactName { get; set; }public string ContactTitle { get; set; }
}}
Now add functions in service class. This is connection string.string conn = "Data Source=.\\SQLEXPRESS;AttachDbFilename=|DataDirectory|\\NORTHWND.MDF;Integrated Security=True;User Instance=True"; Read more: C# Corner
0 comments:
Post a Comment