Windows Scripting
  Home arrow Windows Scripting arrow Creating a Silverlight 2.0 Application tha...
ASP Free Forums 
.NET  
ASP  
ASP Code  
ASP.NET  
ASP.NET Code  
BrainDump  
C#  
Code Examples  
Database  
Database Code  
IIS  
Microsoft Access  
MS SQL Server  
Silverlight  
Visual Basic.NET  
Windows Scripting  
Windows Security  
XML  
Mobile Linux 
App Generation ROI 
IBM® developerWorks 
ASP Web Hosting  
ASP.NET Web Hosting 
Windows Web Hosting
 
Weekly Newsletter
 
Developer Updates  
Free Website Content 
 RSS  Articles
 RSS  Forums
 RSS  All Feeds
Write For Us Get Paid 
Request Media Kit
Contact Us 
Site Map 
Privacy Policy 
Support 
 USERNAME
 
 PASSWORD
 
 
  >>> SIGN UP!  
  Lost Password? 
WINDOWS SCRIPTING

Creating a Silverlight 2.0 Application that Consumes a WCF Service
By: Jagadish Chaterjee
  • Search For More Articles!
  • Disclaimer
  • Author Terms
  • Rating: 5 stars5 stars5 stars5 stars5 stars / 4
    2008-11-05

    Table of Contents:
  • Creating a Silverlight 2.0 Application that Consumes a WCF Service
  • Configuring for Silverlight
  • Writing Code
  • Adding a Project

  • Rate this Article: Poor Best 
      ADD THIS ARTICLE TO:
      Del.ici.ous Digg
      Blink Simpy
      Google Spurl
      Y! MyWeb Furl
    Email Me Similar Content When Posted
    Add Developer Shed Article Feed To Your Site
    Email Article To Friend
    Print Version Of Article
    PDF Version Of Article
     
     
    ADVERTISEMENT


    Creating a Silverlight 2.0 Application that Consumes a WCF Service


    (Page 1 of 4 )

    This is my second article in a series focusing on Silverlight 2.0 (beta 2) development using Visual Studio 2008. This article is for beginners who are quite new to Silverlight development and need a practical introduction to developing Silverlight applications which consume WCF services using Visual Studio 2008.

    If you are new to Silverlight 2.0 development, please refer my first article in this series titled “Beginning Silverlight 2.0 Development Using Visual Studio 2008.”

    If you want to learn about the WCF Service and the WCF Service Library, consider reading my WCF articles listed at http://www.aspfree.com/cp/bio/Jagadish-Chatarji.

    In this article, we will create a new WCF Service and consume it using the Silverlight 2.0 application. Technically, we will have a Silverlight 2.0 Datagrid control consuming rows from a regular WCF Service.

    My development machine is equipped with following environment:

    • Windows Server 2003 with SP2

    • IIS

    • SQL Server 2008

    • Visual Studio 2008 (comes with .NET 3.5) with SP1

    • Microsoft Silverlight Tools Beta 2 for Visual Studio 2008 (includes Silverlight, Silverlight SDK and Tools for VS 2008)

    To make this article simple, I created a new database named “Sample” with the following table (“emp”) on my machine (Fig 01):


    The entire source code for this article is available in the form of a free downloadable zip file. The solution was developed using Microsoft Visual Studio 2008 Team Edition (with SP1) with Microsoft SQL Server 2008 Developer Edition on Microsoft Windows Server 2003 Standard Edition (with SP3) with Silverlight 2.0 Beta 2. I didn’t really test it in any other environment. I request that you post in the discussion area if you have any problems in execution.

    Developing WCF Service using Visual Studio 2008: Creating the project

    Let us start our development with WCF Service.

    Create a blank solution (DemoSln) as follows:


    • Go to File || New || Project.

    • At the top of the “New Project” dialog, make sure that you have selected “.NET Framework 3.5” as your target .NET version.

    • In the “Project Type” (left pane of “New Project” dialog), open “Visual Studio Solutions” in “Other Project Types.”

    • In the “Templates” (right pane of “New Project” dialog), select “Blank Solution.”

    • Provide “DemoSln” as the "Name," your own location, and click “OK.”

    Add a new WCF Service Application as follows:

    • Go to File || Add || New Project (to the existing solution).

    • In “Add New Project,” make sure “.NET Framework 3.5” is selected at the top.

    • Open “Visual Basic” || “Web” in the “Project Types” list.

    • Select “WCF Service Application” as the template.

    • Provide “DemoEmpService” as the name (Fig 02) and click on “OK.”


    More Windows Scripting Articles
    More By Jagadish Chaterjee


       · Hello guys,This is my second article in series focusing on "Siverlight 2.0...
       · This is the most thorough Silverlight data binding I found so far. However I hot...
     

    WINDOWS SCRIPTING ARTICLES

    - More Windows Scripting Workarounds from Nilpo
    - Overloading Methods and More in VBScript
    - Improving MFC for Windows Vista
    - Regular Expressions in VBScript
    - Working with Dates in WMI
    - Completing Calendars with VBScript Date Func...
    - Building Calendars with VBScript Date Functi...
    - Working With Dates and Times in VBScript
    - Designing WCF DataContract Classes Using the...
    - Understanding Dates and Times in VBScript
    - Working With Arrays in VBScript
    - Compressed Folders in WSH
    - Using .NET Interops in VBScript
    - Nilpo`s Scripting Secrets, Vol I
    - Database operations using Silverlight 2.0 WC...





    © 2003-2009 by Developer Shed. All rights reserved. DS Cluster 2 Hosted by Hostway
    For more Enterprise Application Development news, visit eWeek