Windows Scripting
  Home arrow Windows Scripting arrow Page 5 - Database operations using Silverlight 2.0 ...
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

Database operations using Silverlight 2.0 WCF and LINQ to SQL
By: Jagadish Chaterjee
  • Search For More Articles!
  • Disclaimer
  • Author Terms
  • Rating: 5 stars5 stars5 stars5 stars5 stars / 4
    2008-12-10

    Table of Contents:
  • Database operations using Silverlight 2.0 WCF and LINQ to SQL
  • Developing a WCF Service to interact with LINQ to SQL for all CRUD operations
  • Developing a Silverlight 2.0 page to demonstrate CRUD functionality
  • Developing a Silverlight 2.0 page to demonstrate CRUD functionality: code behind
  • Developing a Silverlight 2.0 page to demonstrate CRUD functionality: Explanation

  • 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


    Database operations using Silverlight 2.0 WCF and LINQ to SQL - Developing a Silverlight 2.0 page to demonstrate CRUD functionality: Explanation


    (Page 5 of 5 )

    This section explains the code given in the previous section.

    The constructor in UI class is as follows:


    Public Sub New()

    InitializeComponent()

    InitiateContext()

    InitiateHandlers()

    End Sub


    “InitiateContext” and “InitiateHandlers” are custom methods developed especially to ease our process. The “InitiateContext” method instantiates a WCF Service client object (objService) along with a business object (objEmp). Once the instantiatiations are completed, the business object (objEmp) is assigned to the “DataContext” property of the “LayourRoot” container control to enable “Two-Way” data binding (explained in detail in my previous article).

    Every WCF method from Silverlight UI is accessed asynchronously. Once the method at the WCF Service gets processed, the call back mechanism gets back to the method in Silverlight UI and then executes it. For call back mechanisms to work, we should register the handlers. This is handled in “InitiateHandlers.”

    Every operation (a WCF method, for example) gets executed at the WCF Service in an asynchronous fashion. The following are the statements which access the WCF methods asynchronously:


    objService.AddAsync(objEmp)

    objService.DeleteAsync(objEmp.Empno)

    objService.UpdateAsync(objEmp)

    objService.GetEmployeeAsync(objEmp.Empno)

    You can also observe that the same business object (objEmp) is passed while calling the respective WCF method.

    In my upcoming articles, we will see more and more examples of Silverlight 2.0 development together with LINQ to SQL and WCF. I hope you enjoyed the article and any suggestions, bugs, errors, enhancements etc. are highly appreciated at http://jagchat.spaces.live.com


    DISCLAIMER: The content provided in this article is not warranted or guaranteed by Developer Shed, Inc. The content provided is intended for entertainment and/or educational purposes in order to introduce to the reader key ideas, concepts, and/or product reviews. As such it is incumbent upon the reader to employ real-world tactics for security and implementation of best practices. We are not liable for any negative consequences that may result from implementing any information covered in our articles or tutorials. If this is a hardware review, it is not recommended to open and/or modify your hardware.

       · Hai,This is my next in series focusing on development using Silverlight 2.0, WCF...
       · Excellent Article. But is it the best solution or there are any other solutions as...
     

    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 4 Hosted by Hostway
    For more Enterprise Application Development news, visit eWeek