+2  A: 

There are 3 options that I know of for connecting to a database from Silverlight:

  • WCF: Create your own WCF service with methods like GetCustomers(), UpdateCustomers() and DeleteCustomers(). Those methods are implemented on the server side, so in the background you can use LINQ to SQL or just open an old-fashioned SqlConection and run some SqlCommands against the database.
  • ADO.NET Data Services: This is a custom WCF service implemented by MS. You point the service at an Entity Framework class (auto generated from your custom database, super easy to create) and in turn it'll accept standard http rest commands that that do things like GetCustomers/Update/Delete. You can then add a service reference to this guy from your Silverlight app and it will auto generate 1 class per table, etc along with a client to connect to the server (http port 80 so no firewall concerns here). On the client side you're interacting with rich classes that look just like your database structure and work well with LINQ. This is not Silverlight specific and could be used from any client, even a console app.
  • .NET RIA Services: This is like ADO.NET Data Services but adds support for many things Silverlight including property change notification on the client side (note that the bleeding edge CTP2 of ADO.NET Data Services also implements change notifications), easy to hook events for browser navigation (i.e. you get an event when the user clicks back or forward) and code sharing between the server and the client (just name your file MyClass.shared.cs in your ASP.NET application and it magically shows up in your Silverlight client).

All of these options use http port 80 so they'll work well with your firewall. I'd really encourage you to try all 3 if you've got the time. If you don't have the time go directly to ADO.NET Data Services (grab the CTP2 you'll appreciate the new features).

Plain vanilla SL + WCF + SQL, but it's a little old: http://msdn.microsoft.com/en-us/magazine/cc794260.aspx

Shawn Wildermuth's MSDN article is a good starting point for ADO.NET Data Services: http://msdn.microsoft.com/en-us/magazine/dvdarchive/cc794279.aspx

This will get you up and running with good results in short time but note that it uses beta software. You'll see how many improvements have been made to ADO.NET DS since Shawn wrote that previous article: http://blogs.msdn.com/astoriateam/archive/2009/09/01/introduction-to-data-binding-in-ctp2.aspx

And here's Brad Abram's mother of all data connectivity posts (RIA Services focus here - I think the series is up to 24 parts now): http://blogs.msdn.com/brada/archive/2009/08/02/business-apps-example-for-silverlight-3-rtm-and-net-ria-services-july-update-summary.aspx

James Cadd
Somebody's RSS reader is full of Silverlight stuff... I don't know anyone else like that ;)
Dave Swersky
Full of stuff that I never have time to read ;)
James Cadd
This is some great stuff. I'm watching Brad Abrams' Mix demo now. The only thing I would add is a few notes regarding setting up SQL Server Express 2008. Maybe I'll answer my own question with that bit a little later.
Ben McCormack