AccessMyLibrary provides FREE access to over 30 million articles from top publications available through your library.
Create a link to this page
Copy and paste this link tag into your Web page or blog:
Byline: Tim Anderson
Silverlight revisited
Delve deeper into coding using Microsoft's web framework
Last year's two-part feature (December and Christmas 2008 issues) on coding a Silverlight 2.0 application (see screen 1) has attracted numerous comments and queries. The feature showed how a desktop database application could become a cross-platform web application using Silverlight, but there was not room to show all the code or discuss all the issues. This follow-up fills some of those gaps, and all the code is available for download.
The example application is an image database. Users can browse through a list of images, view them, search for an image, and add or amend existing records. The earlier article covered how to create a Silverlight application together with an ASP.Net web service, and call the web service from Silverlight to populate a DataGrid. The web service queries an SQL Server database and images are not actually stored in the database, but instead there is a link to each image on the web server.
The challenge of applications such as this is that they are distributed applications. Many Windows Forms applications either work entirely locally or communicate with a server only through a database connection. In a classic web application, most of the code runs on the server, with the web browser simply displaying the output. Rich Internet Applications such as those built with Silverlight, Flash or Javascript are different because there is significant coding to do both on the client and on the server. If it is on the internet, the whole world can have a crack at your application, so security is critical. It is no use implementing security checks in the Silverlight application itself, since this code is untrusted. Somebody might decompile your application and modify it, or work out what web service calls it is making and duplicate them in some other application.
Visual Studio 2008