Tag Archives: Silverlight

Microsoft Silverlight

Silverlight & SQL server connection

You can’t. Instead you should create a WCF service one server that Silverlight can talk to.

Tutorial that does that: http://silverlight.net/learn/tutorials/sqldatagrid.aspx

Your Silverlight app has two projects. One Aspx project for server side, one silverlight on client side.

Your database resides on server side.

You can access it from server side aspx project.

Client side doesn’t know about database.

You can use WCF for connection.

Direct connection is not possible to the database.

IIS Silverlight

How to solve Unhandled Error in Silverlight Application Code: 2104

The Problem: You ftp a Silverlight App to an IIS website, go to the website in a browser, and get the following error:

Message: Unhandled Error in Silverlight Application
Code: 2104
Category: InitializeError
Message: Could not download the Silverlight application. Check web server settings

The Cause: The Silverlight Mime types (.xaml, .xap and .xbap) are not listed in that websites registered mime types, therefore IIS will not send those files to the browser.

The Solution: Open IIS on the server, go to HTTP headers, click on Mime Types, click “Add New” and add the following:

Extension – Mime Type
.xaml – application/xaml+xml
.xap – application/x-silverlight-app
.xbap – application/x-ms-xbap

Hit Apply and your application will load!