14.19. Network Communications

Normally in an ASP.NET application you retrieve data from the database server using the System.Data classes. In Silverlight, because your application is running on the user's machine, you cannot (and should not) connect directly to your SQL Server. Data is instead retrieved using calls to a web service.

When retrieving data, you don't want your application to pause execution, so all web service calls from Silverlight must be made asynchronously. For more information about Silverlight and communications, please refer to http://silverlight.net/learn/videocat.aspx?cat=2#HDI2WebServices and www.west-wind.com/weblog/posts/546995.aspx.

Get Introducing .NET 4.0: with Visual Studio 2010 now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.