Basic interoperability between Silverlight and the background database)

Source: Internet
Author: User

Http://silverlightchina.net/html/tips/2009/0826/153.html

This section provides three technologies for Silverlight and background databases to achieve basic interoperability (silverlinght interoperability) and build a Silverlight SOA application. Prerequisites: Windows 2003/2008/Vista visual studio.net 2008 + SP1 Silverlight 3.0 SDK silverlight3 tools Microsoft E

Introduction

 

This section provides three technologies for Silverlight and background databases to achieve basic interoperability (silverlinght interoperability) and build a Silverlight SOA application.

 

Prepare the environment

 

Windows 2003/2008/Vista

Visual studio.net 2008 + SP1

Silverlight 3.0 SDK

Silverlight3 tools

Microsoft Expression blend 3

Riaservices. MSI

Riasevicespreviewbusinessapplication. MSI

 

Prerequisites

 

Familiar with. NET Framework 3.5

Understand Silverlight Development

Measure the test taker's understanding about LINQ development.

Understanding ado.net Data Service

 

 

Main Content

 

Create a Silverlight ApplicationProgram

Create a common WCF Service to provide Silverlight application calls for Interoperability

Create an ado.net data service to provide Silverlight application calls for Interoperability

Create a domain service (RIA-link) to provide Silverlight application calls for Interoperability

 

Create a Silverlight Application

 

After the above development components are installed, the Silverlight Project template will be added to visual studio.net 2008. You can choose Silverlight navigation application or Silverlight business application to create

Solution Structure

Running page

Add new pages instead of user control. After the RIA service is installed, many Silverlight project templates will be added, which will be very convenient for you to use during application development.

 

Create a common WCF Service to provide Silverlight application calls for Interoperability

 

 

Define a WCF Interface

 

1Execute SQL (insert, update, delete) to achieve database interoperability

2Run SQL (select) to obtain the returned dataset and return it as a string.

 

SilverlightCall WCF

 

The add, delete, edit, and query functions are implemented by calling the two interfaces provided by WCF.

Note: The Silverlight DataGrid Control cannot bind anonymous objects.

 

 

Create an ado.net data service to provide Silverlight application calls for Interoperability

 

 

Add a LINQ Data Source

 

You can select ado.net Entity Data Model or LINQ to SQL classes.

 

Add an ado.net Data Service

 

 

SilverlightCall ADO. NET data service

 

Add, delete, edit, and query functions by calling the interface provided by ado.net Data Service

Full reference to the implementation of the new function is made to the implementation of the LINQ to SQL method. The only difference is that the asynchronous method must be called for implementation.

 

Create a domain service (RIA-Link)Provide Silverlight application calls for Interoperability

 

 

Add a domain service

 

Select domain service class

Select the entity class and Operation Method to publish the service. Metadata class allows you to conveniently verify and control the display format of the entity class.

 

SilverlightCall RIA-LINK for Interoperability

 

Add, delete, edit, query by calling the interface provided by the RIA-LINK

RIA-LINK (silverlightapplication3.web. G. CS)

The difference is that you no longer need to call asynchronous methods to implement these functions, and you do not need to reference services.

 

Ria serveFramework

 

 

 

 

Comparison of Three implementation methods

 

WCFService

ADO. NET data service

Ria Service

Build Application Efficiency

Low

High

High

Scalability

Good

Difference

Good

Security

Medium

High

High

Performance

Medium

Medium

High

Database compatibility

Good

Only ms SQL is supported

only supports ms SQL

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.