Microsoft Silverlight 3 includes support for creating Rich Internet Applications with virtually no code at all. In this article, I will create a simple RIA application which displays data from the SQL Server 2005 AdventureWorks database. For those who are wondering what RIA services are? Its a pattern which integrates ASP.NET with Silverlight and provides a simple way to write n-tier applications. What I admired about RIA services applications are it brings your database logic to your business layer. What that means is that your database and Data access layer virtually contains no application specific code at all. In future, upgrading, migrating to any other database is amazingly simple. There is the element of a performance implication while using Linq though, which needs to be taken into consideration. Thanks to Sachin Rathi from Microsoft for his session in TechDays where he taught about this new topic.
So lets jump into it. First the tools, which can be downloaded from here. The fifth point in the list is the RIA kit. Once thats done, you would have a new template – Silverlight Business Application.
So like we saw in the previous blog, there are two applications created – one for our Silverlight application and one for the ASP.NET application. The basic application is already created with a decent theme.
Lets create a new xaml page for displaying our data created by the RIA applications. Right click on the Views folder and add a new Silverlight page.
Now that the new Silverlight page is created, lets add a link to it from the main page. Add this markup after the link to the about page.
employees _eObj = new employees(); public EmployeesPage() { InitializeComponent(); this.dataGrid.ItemsSource = _eObj.Employees; _eObj.Load(_eObj.GetEmployeeQuery()); }
This application is by no means over, we can add sorting, filtering, updating rows to this with as little code as possible. More about it in future posts.












