Sunday, January 8, 2012

How to create and consume WCF Service in Silverlight?

As we know that Silverlight (being a sandbox technology) doesn't support working directly with ADO.NET, it implies that you can't use ADO.NET code like SqlConnection, SqlCommand or SqlDataAdapter to connect to the database and fetch records or manipulate records. So the only option left is to interact with the services (either web or wcf).

NOTE: In case you are creating services in different project than the Silverlight hosting project, you need to specify the client access policy (in the client/consumer project) and cross domain policy (in the server project).

This article is the continuation of my last article in Silverlight controls series, read last article here.