In this demo we are going to see how to build Silverlight 2.0 Application using LINQ, with Northwind Database.
Create a Silverlight Application, when you do it in VS 2008 you will get option to add a web site to host the silverlight application or create a test aspx page or link to existing web site.
In this demo we are going to use Add a new web site. Silverlight cannot be run as a standalone application for that we need to have web service to provide the data. Here I'm going to use WCF Web Service to load categories information, insert, update and category.
We are going to do one by one, Add New Item - LINQ to SQL Classes
This will give a LINQ automate generated class to bind with SQL Server. Connect to SQL Server in the Left handside Server Object. You can drag and drop Northwind Table you will get the dbml like the image below.
This was you will get LINQ Classes. This will help us to bind the SQL Server with the Application using LINQ. You can able to drag and drop stored procedures as well from the SQL Server onto the LINQ Class. After creating I got a class with NorthwindDataContenxt to Connect.
In next page you will know how to create WCF Service to access the methods.