Tuesday, August 31, 2010

WCF Services and Silverlight 4: Basic example using WCF Services

Where is the data classes to get information from databases? I can't find them. We'll you can stop looking because they don't exist in silverlight. The answer to getting data into your silverlight application is web services. In this post I will show the basic steps to get data into your silverlight application using WCF services.

To begin open up Visual Studio 2008 or Visual Studio 2010. Select File ->New->Project. Select the silverlight application template, give it a name and click OK. After clicking OK, visual studio present a dialog box allowing you to choose which silverlight version you want to target, an option to enable wcf ria services, and the web project type. For the purposes of this post, accept the default and click OK.

Monday, August 30, 2010

Using the GridView,DetailsView with Asp.net 3.5 and LinqToSql

In this post I will demonstrate how to use the Asp.net GridView and DetailsView control with LinqToSql. Let's begin by creating an Asp.net web project in Visual Studio 2010. Now that our project template is created, add a new webform to the project, call it DetailsPage or name it whatever you want.

Open up the Default.aspx page and drag a GridView control onto the design view. The Default.aspx page is where we will search the database for data. Once we get data back, the user will be able to select a record from the GridView which will redirect them to the DetailsPage.aspx where they can edit the record and submit their changes.