In this Post I want to talk with Silverlight and it's interaction with database .  Oh, I thing I want to tell you that I'm using SQL database .  Oracle also may be performed.  I don't have any knowledge in that . So , basically I'm using SQL -2008 and Visual Studio 2010. These two software you need to make this application. And I'm using Linq Query to retrieved data from database.  I'll describe this with step by step .

 Ok, if you search in internet or Google "How to connect Database with Silverlight". I find lots of good and efficient learning resources in there .  Most of them are either using Linq to Sql Class or ADO.NET Entity Framework Class. Because using both of them make you end up writing lots of code and visual studio will do lots of heavy tasks for you.  And when you use WCF Services with them surprising thing is that tools automatically generate a set of proxy classes which are all be based on the design of your database . And also the relationship between one table to another will be automatically designed by the proxy classes. So, in without any doubt we can say that using bothLinq to Sql Class orADO.NET Entity Data Model are best choice to do work with Database.

Fine, but In my this tiny application I do work with database without help of ADO.NET Entity Data Model or Linq to Sql Class. Yes , you do not need to go add extra item(Linq to SQL ,or etc …) in your server side  in Silverlight Application. To make application get rid of complexibility. I just do work with one table in SQL 2008, latter if I get more time I shall post another article with two or more tables.  But , I think if you can able to connect or make able to design your Silverlight application to connect the database as I explained here how to do that , then it is not very difficult to do work with multiple tables.

Ok, now  come into another thing . "How can Silverlight communicate with data ?". Because we know that Silverlight is a client side technology(I'm not going details about it in here). There are some technologies through these you can perform this task . Like, Simple Web Services  for e.g. ASP.NET WebServices (.asmx extension), SOAP, JSON (it is java script object notation basically provides serialization services ) and WCF Secvices (Windows Communication Foundation is a vast use and most technology , which is a set of web services that will provide you security and reliability more easily than other web services).

I'm using in my application WCF Service. For more details about it See MSDN about WCF Services.  Oh, one excellent portion of WCF service is that it is use RESTful interface. REST in full form is that Representational State Transfer.  Actually it do work by a defining an address for your services and passing   a query to that service. By this technique, service itself figure out that what you want returned. Thus , this method give a great advanced to you that you don't need to write any insert, update or delete operations in server side . you just write one query and get your result.

Read More.....